Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <stdio.h>
- #include <iostream.h>
- #include <windows.h>
- // Exported VB functions we'll be calling:
- typedef void (__stdcall * PFUNC)(void);
- int main(int argc, char* argv[])
- {
- HINSTANCE hMod = 0;
- PFUNC pFunc = NULL;
- char dummy;
- cout << "cargando lib \"exports.dll\"\n";
- // Load the VB DLL:
- hMod = LoadLibrary(".\\exports.dll");
- cout << "hMod=" << hMod << "\n";
- if (hMod)
- {
- // Call the export:
- pFunc = (PFUNC)GetProcAddress(hMod, "ShowForm");
- cout << "pFunc*=" << pFunc << "\n";
- if (pFunc)
- {
- //MessageBox(NULL, "Calling the ShowForm export...","Calling ShowForm",0);
- cout << "llamando \"ShowForm\" de \"exports.dll\"\n";
- pFunc();
- } else
- cout << "proc not found \"ShowForm\"\n";
- FreeLibrary (hMod);
- } else
- cout << "error cargando lib\n";
- cin >> dummy;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment