|
 |
|
|
Hi Mahmood, I am Ajit.
I really learn quickly how to interact with DLLs.It helped me to get good start.
Thank you.
Ajit
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
Hi All,
Could someone pls help me get this error out... I'm unable to declare the function with a vector type.
//errors creepdll.h expected `;' before '(' token creep.cpp no `double Creep::GetEvent(std::vector >, int)' member function declared in class `Creep' [creep.o] Error 1
// Original code
// Creepdll.h
//#define DLLEXPORT __declspec(dllexport)
class Creep { public: __declspec(dllexport)double GetEvent(vector event, int value); };
// compile with: /EHsc /LD
#include "creepdll.h" #include #include #include // Header for vector class using namespace std;
double Creep::GetEvent(vector press, int number_to_sum) { double presspress = 0.0; return presspress; }
//Main .exe
#include #include #include "creepdll.h" #include // Header for vector class
using namespace std;
int main(void) { Creep a; a.GetEvent(); system("PAUSE"); return 0; }
Gee
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
When try to use the function the app crash! I don't know why. And yes maybe it's a good article, but it's like the help in VisStudio (2005 but in all). It' just not enoughtly detailed! Ex. Where to put the code??? In my case, couse I'm used C++ all in my life. I can find out. (shirimasen ) But for those who is new to C++ and VC++ it will be a pain anyway.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Any more help on this topic? I am having the same problem:
typedef int (CALLBACK *PC_DLL_SHUTDWN)(void);
main() { dllHandle = LoadLibrary("C:\\views\\pc\\AppDll\\Debug\\PcAppDll.dll"); if (dllHandle == NULL) exit(1); // dllHandle = 0x10000000 doesn't look right does it?
//Get pointer to our function using GetProcAddress: PcDllShutdownPtr = (PC_DLL_SHUTDWN)GetProcAddress(dllHandle, "PcDllShutdown");
// PcDllShutdownPtr is NULL; what do you think???? }
gdog
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Wrote codes for MFCAppWizard(dll). Can't figure out where in files to place codes for the MFCAppWizard(exe). codes: typedef int (CALLBACK* LPFNMLTPLY)(int,int); HINSTANCE hClcltr=LoadLibrary("DefExported.dll"); LPFNMLTPLY lpfnMuliply; lpfnMuliply = (LPFNMLTPLY)GetProcAddress(hClcltr,"Multiply"); m_Rslt=lpfnMuliply(m_PartOne,m_PartTwo); FreeLibrary( hClcltr );
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi Mahmood, I have spent enough time in getting a good idea about DLLs. Asked so many people, they used to start and get some errors and run away. My question was simple to them, "I want to write a dll to add two number". But, your articles are funtastic, very simple, but good information.
Thanking you heartly.
Prasanna Joshi "Life is set of uncertain events. Be carefull before making a statement"
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
class CAddDllApp : public CWinApp { public: int Add(int a,int b); CAddDllApp(); .... }; int CAddDllApp::Add(int a, int b) { return a + b; } Enter "Add @1" after the EXPORT statement, but error . =========================================== --------------------Configuration: AddDll - Win32 Debug-------------------- Compiling... AddDll.cpp Linking... .\AddDll.def : warning LNK4022: cannot find unique match for symbol "Add" ....(many warings!!!).... LINK : fatal error LNK1152: cannot resolve one or more undecorated symbols LINK : fatal error LNK1141: failure during build of exports file Error executing link.exe.
AddDll.dll - 2 error(s), 14 warning(s) =========================================== How can i do?thanx!(i'm biginner)
|
| Sign In·View Thread·PermaLink | 1.67/5 (5 votes) |
|
|
|
 |
|
|
I am having the same problem!
plz~ can anyone answer this? what does that mean anyway...?
thanks.. (im new too)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
First thanks for good article 
i need help, if i want to create file setup.ext or .msi by create "Setup and deployment project" in VS.NET for setup .dll, what custom action i should to code(in VC++)? (i am a beginner) in DOS i use "regsvr32"
plss
rlaley...girl
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Hi rlaley, thanx for applause ; excuse me , i'm very busy. please describe details,what you mean setup.dll regard mahmood
|
| Sign In·View Thread·PermaLink | 1.00/5 (2 votes) |
|
|
|
 |
|
|
I have a project(.exe) that when I compile it I can see in the compiler windows "automatically linking" the application automatic link to the DLL. I know only two ways to link/load a dll 1. add the .lib 2. LoadLibrary function. Do you know how to make the application to load/Link the dll automatically.
Thanks, Yossi Email bym040@motorola.com
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
You must add linker options yourdll.lib, In Vc++ 6 Menu-> Project-> settings ( Tab Link) , section Object/library Modules .. Add yourdll.lib. Before you must have to include header file with prototypes functions. You can use functions DLL without call Loadliibrary function.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Hi, Nice simple article. I had an idea and I need some more advanced dll stuff and I was wondering if you could point me in the right direction. I want to replace my computers winsock.dll with another winsock.dll that I create, renaming winsock.dll. My dll would have exactly the same functions as winsock.dll, and may call functions from the renamed winsock.dll. The reason I want to do this is so I can: 1. Get some firewall functionaility. 2. Monitor what my apps are doing. (Which ports are they listening to etc.)
I am at the reserch stage of this project. I want to scan the winsock.dll file and find what functions it exposes. (Rather than rely on dodgy & incomplete &soft socumentation.)
Any help or pointers for research, or is my idea plain stupid? Thanks Rob
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
Dont physically replace system dll's with your own one's instead of that use so called API hijacking to achieve your aim.
As a matter of fact API hijacking means replacing of system API calls with your own functions wothout touching the dlls themselves.
E.g: if you install a system wide hook into the "send" function of ws2_32.dll, then every time some application calls this original system function (i.e. tries sending data), your function is called first. In your function you have the ability to monitor the parameters passed to the original function (e.g. the buffer to be sent) and call the original system function with modified parameters (e.g. a modified buffer), or not call it at all.
However, in your case when a firewall is concerned, it is not enough to hijack one single API function, like the "send" winsock function because IE does not use sockets to communicate with the outer world but it uses the wininet library, and its API functions.
For API hooking check out: http://www.codeproject.com/system/hooksys.asp[^]
Peter Molnar
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
To answer your question, though: you can check what is in a dll by using dumpbin to get the exports table. Dumpbin is probably in the \bin path of your development package.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
I am not a c++/vc++ programmer. But I am fascinated by the simplicity of your article. Hope more will come on this line. A '5' from me...
Enjoy Coding, Rajesh Pillai
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
 |