Register DLL w/o regsvr32.exe

This is a discussion on Register DLL w/o regsvr32.exe within the Windows Programming forums, part of the Platform Specific Boards category; Would this work? Code: int regDll(char *dllPath) { if (strlen(dllPath) == 0) return 1; /* get handle to dll */ ...

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    4

    Register DLL w/o regsvr32.exe

    Would this work?
    Code:
    int regDll(char *dllPath) 
    {
    	if (strlen(dllPath) == 0) return 1;
    	
    	/* get handle to dll */
         HINSTANCE hGetProcIDDLL = LoadLibrary(dllPath);
    
         /* get pointer to the function in the dll */
         FARPROC lpfnGetProcessID = GetProcAddress(HMODULE(hGetProcIDDLL), "DummyFunction");
    	
    	 /* release DLL */
         FreeLibrary(hGetProcIDDLL);
    
         return 0;
    }
    
    void DummyFunction (void) {};
    Edit: I just realized that I don't have the register routines in here yet.
    Last edited by il96; 03-15-2004 at 12:26 PM.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    I dont have any compilers installed right now so I cant give a working example.....but I can give you this link which does the business

    http://support.microsoft.com/default...;en-us;q140346

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 07:11 AM
  2. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  3. dll communicating between each other
    By cloudy in forum C++ Programming
    Replies: 5
    Last Post: 06-17-2005, 02:20 AM
  4. DLL and std::string woes!
    By Magos in forum C++ Programming
    Replies: 7
    Last Post: 09-08-2004, 12:34 PM
  5. .lib vs .h vs .dll
    By Shadow12345 in forum C++ Programming
    Replies: 13
    Last Post: 01-01-2003, 04:29 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21