This is actually a C++ question, so this is maybe not the right forum. I would like to import a PB-dll in C++. Has anyone tried that? I am using VC++ version 6.
Regards
Peter
Regards
Peter
PB Code: FUNCTION SayHello(BYREF pszText AS ASCIIZ) EXPORT AS LONG pszText = "Hello!" END FUNCTION C Code: #include <windows.h> typedef int __stdcall SAYHELLO(CHAR* pszTest); int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow) { UCHAR szText[120]; HMODULE hMyDll; SAYHELLO* pSayHello; long r; hMyDll = LoadLibrary("foo.dll"); if (hMyDll == NULL) MessageBox(0, "Failed to load dll", NULL, 0); else { pSayHello = (SAYHELLO*)GetProcAddress(hMyDll,"SAYHELLO"); if (pSayHello == NULL) MessageBox(0, "Failed to find func", NULL, 0); else { r = pSayHello(szText); MessageBox(0, szText, NULL, 0); } } FreeLibrary(hMyDll); MessageBox(0,"Done!",NULL,0); }
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment