-
DLLs (dev c++ and borland c++ builder 6)
ok i have 2 projects:
1: win32 app made with borland C++ builder 6 trial which is a program that basicly just opens the second file when you click a button. this file is a .exe.
2. a consol app made with Dev C++ that will get opened when you click a button in the program above.
now it all works fine if i have 2 .exe's and have program #1 open the exe for program #2... but thats not cool enough. I'm a bigginer and i have no clue how anything works but i'm wondering if thers a way to make it like that:
program 1= .exe
program 2=.dll
and i want it so that when i click the button it loads the dll or watever and opens the consol app.
i dunno if this is how dlls work or anything but if not is there any other similar way to do this?
i do have #2 compiled as a .dll allready.
If thats impossible is there any way i could make it so file #2 cannot be directly opened?
-
Registered User
If you want to access functions in a dll, use LoadLibrary() and GetProcAddress() (there's example code in there too).
If you want execute another process, use CreateProcess() or, in the MS C standard library, the _exec functions (also has a code example).
gg
-
well what i want is my dll to contain a totally diffrent program that opens when i call the library or whatever. I dont want it to return a function. i just want it to run whats in the dll as a consol app.
is this possible?
-
Registered User
You can do that using either of the methods I posted. It would be easier for you to not compile it as a DLL, compile it as an EXE and use either CreateProcess() or one of the _exec functions to run your EXE.
gg
-
oook.... i think ill just stick to exes for now :S
Popular pages
Recent additions