Silme94
Silme94
CC#
Created by Silme94 on 7/12/2024 in #help
Windows Forms Wrong color help
No description
4 replies
CC#
Created by Silme94 on 6/29/2024 in #help
FlowLayoutPanel TopDown problem
No description
2 replies
CC#
Created by Silme94 on 6/19/2024 in #help
✅ Database cmd.ExecuteScalar() ERROR
No description
17 replies
CC#
Created by Silme94 on 6/11/2024 in #help
Windows Forms EXE
When i compile my app to Release, the machine require dotnet or else it shows a messagebox thats tell to install it, however i dont wanna this.
10 replies
CC#
Created by Silme94 on 4/17/2024 in #help
✅ ImGui.NET and OpenTK
hello, i tried to render a basic imgui window on my opentk window, but it just dont works and crash with an exception
using System;
using ImGuiNET;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL4;
using OpenTK.Mathematics;
using OpenTK.Windowing.Common;
using OpenTK.Windowing.Desktop;

namespace ImGuiWithOpenTK
{
class Program
{
private static GameWindow gameWindow;

public static void Main(string[] args)
{
NativeWindowSettings nativeWindowSettings = new NativeWindowSettings
{
Size = new Vector2i(800, 600),
Title = "ImGui with OpenTK",
API = ContextAPI.OpenGL,
APIVersion = new Version(4, 6),
};

GameWindowSettings gameWindowSettings = new GameWindowSettings
{
UpdateFrequency = 60
};

gameWindow = new GameWindow(gameWindowSettings, nativeWindowSettings);

gameWindow.Load += GameWindow_Load;

gameWindow.RenderFrame += GameWindow_RenderFrame;

gameWindow.UpdateFrame += GameWindow_UpdateFrame;

gameWindow.Run();
}

private static void GameWindow_UpdateFrame(FrameEventArgs obj)
{

}

private static void GameWindow_RenderFrame(FrameEventArgs obj)
{
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

ImGui.NewFrame();
ImGui.Begin("Demo windows");
ImGui.Text("Hello world");
ImGui.End();
ImGui.Render();

gameWindow.SwapBuffers();
}

private static void GameWindow_Load()
{
GL.ClearColor(Color4.CornflowerBlue);

ImGui.CreateContext();
ImGuiIOPtr io = ImGui.GetIO();
ImGui.StyleColorsDark();
}
}
}
using System;
using ImGuiNET;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL4;
using OpenTK.Mathematics;
using OpenTK.Windowing.Common;
using OpenTK.Windowing.Desktop;

namespace ImGuiWithOpenTK
{
class Program
{
private static GameWindow gameWindow;

public static void Main(string[] args)
{
NativeWindowSettings nativeWindowSettings = new NativeWindowSettings
{
Size = new Vector2i(800, 600),
Title = "ImGui with OpenTK",
API = ContextAPI.OpenGL,
APIVersion = new Version(4, 6),
};

GameWindowSettings gameWindowSettings = new GameWindowSettings
{
UpdateFrequency = 60
};

gameWindow = new GameWindow(gameWindowSettings, nativeWindowSettings);

gameWindow.Load += GameWindow_Load;

gameWindow.RenderFrame += GameWindow_RenderFrame;

gameWindow.UpdateFrame += GameWindow_UpdateFrame;

gameWindow.Run();
}

private static void GameWindow_UpdateFrame(FrameEventArgs obj)
{

}

private static void GameWindow_RenderFrame(FrameEventArgs obj)
{
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

ImGui.NewFrame();
ImGui.Begin("Demo windows");
ImGui.Text("Hello world");
ImGui.End();
ImGui.Render();

gameWindow.SwapBuffers();
}

private static void GameWindow_Load()
{
GL.ClearColor(Color4.CornflowerBlue);

ImGui.CreateContext();
ImGuiIOPtr io = ImGui.GetIO();
ImGui.StyleColorsDark();
}
}
}
71 replies
CC#
Created by Silme94 on 4/13/2024 in #help
✅ Using a C# DLL in C++
im actually trying to call a C# dll from c++ with DllExport, the c++ code return no error but dont execute the functions, here is the source : C# :
using System.Runtime.InteropServices;
using System;


namespace InternalTest
{
public class Class1
{

[DllImport("user32.dll")]
public static extern int MessageBox(int hWnd, string text, string caption, uint type);


[DllExport(CallingConvention = CallingConvention.StdCall)]
public static void DllEntryPoint()
{
Console.WriteLine("This is a message from C#");
MessageBox(0, "C# is good", "hello world", 0);
}
}
}
using System.Runtime.InteropServices;
using System;


namespace InternalTest
{
public class Class1
{

[DllImport("user32.dll")]
public static extern int MessageBox(int hWnd, string text, string caption, uint type);


[DllExport(CallingConvention = CallingConvention.StdCall)]
public static void DllEntryPoint()
{
Console.WriteLine("This is a message from C#");
MessageBox(0, "C# is good", "hello world", 0);
}
}
}
C++ :
#include <stdio.h>
#include <Windows.h>

int main(int argc, char **argv) {
if (argv[1] == NULL) {
printf("Usage : dll_executor <DLL_PATH>\n");
return -1;
}

char* Dll_Path = argv[1];
HMODULE hModule = LoadLibraryA(Dll_Path);
if (hModule == NULL) {
printf("Failed to load the dll.\n");
}

LPCSTR Function_To_Execute = "DllEntryPoint"; // Function to execute in the dll

HANDLE hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(hModule, Function_To_Execute), NULL, 0, NULL);
if (hThread == NULL) {
printf("Failed to create thread.\n");
}

printf("Dll Executed!\n");
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
FreeLibrary(hModule);

return 0;
}
#include <stdio.h>
#include <Windows.h>

int main(int argc, char **argv) {
if (argv[1] == NULL) {
printf("Usage : dll_executor <DLL_PATH>\n");
return -1;
}

char* Dll_Path = argv[1];
HMODULE hModule = LoadLibraryA(Dll_Path);
if (hModule == NULL) {
printf("Failed to load the dll.\n");
}

LPCSTR Function_To_Execute = "DllEntryPoint"; // Function to execute in the dll

HANDLE hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(hModule, Function_To_Execute), NULL, 0, NULL);
if (hThread == NULL) {
printf("Failed to create thread.\n");
}

printf("Dll Executed!\n");
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
FreeLibrary(hModule);

return 0;
}
The cpp code says that it got executed but it doesn't really
49 replies
CC#
Created by Silme94 on 4/9/2024 in #help
C# DLL failed to load
No description
23 replies
CC#
Created by Silme94 on 3/20/2024 in #help
✅ Cannot make an label background color transparent (On a picture box)
No description
32 replies
CC#
Created by Silme94 on 11/18/2022 in #help
❔ System.Net.Http Not Found
18 replies
CC#
Created by Silme94 on 11/16/2022 in #help
user32.dll how to add icon on message box
how to add icon on user32.dll msgbox?
using System;
using System.Runtime.InteropServices;

class Program{

[DllImport("user32.dll", CharSet = CharSet.Unicode)]
public static extern int MessageBox(IntPtr hW, String content, String title, uint type);
public static string text;
public static string argument;
static void Main(string[] args){
for (int i = 0; i < args.Length; i++)
{
argument = argument + " " + args[i];
}
text = argument;
MessageBox(new IntPtr(0), text, "Error", 0);
}
}
using System;
using System.Runtime.InteropServices;

class Program{

[DllImport("user32.dll", CharSet = CharSet.Unicode)]
public static extern int MessageBox(IntPtr hW, String content, String title, uint type);
public static string text;
public static string argument;
static void Main(string[] args){
for (int i = 0; i < args.Length; i++)
{
argument = argument + " " + args[i];
}
text = argument;
MessageBox(new IntPtr(0), text, "Error", 0);
}
}
3 replies
CC#
Created by Silme94 on 11/16/2022 in #help
❔ Space Problem
12 replies
CC#
Created by Silme94 on 11/13/2022 in #help
Copying File Error (not working)
62 replies