Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27347

How to change variable in dll file using vb.net

$
0
0
Hello,

I got a vb.net software and a dll file which is written in C++ code. Now I want to pass a variable from vb.net software to the dll file and also vice versa. How can I do that in my vb.net software?

My DLL File Code:
Code:

#include "stdafx.h"
#include <windows.h>
#include <stdio.h>

#define CC_PRINTF 0x004FCBC0

void(*printConsole)(int mode, const char* text) = (void(__cdecl*)(int, const char*))CC_PRINTF;

DWORD WINAPI consoleThread(LPVOID)
{
        while (1)
        {
                if (GetAsyncKeyState(VK_F5))
                {
                        printConsole(0x10, "uG!");
                }
                Sleep(100);
        }
        return 0;
}

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
        if (fdwReason == DLL_PROCESS_ATTACH)
        {
                CreateThread(NULL, 0, consoleThread, NULL, 0, NULL);
        }
        return TRUE;
}


Please help me guys on how can I communicate between C++ dll and vb.net program.
Thanks in advance....

Viewing all articles
Browse latest Browse all 27347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>