1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Simply DLL

Discussion in 'Tools programming' started by ras78, 9/5/07.

  1. ras78

    ras78

    Joined:
    1/9/05
    Messages:
    374
    Country:
    italy
    Hello guys,
    I'm trying to crate a simply dll for my scenery. With this dll I should be able to set values for usrvr5 and therefore, condition my objects.
    Basically I read an offset and set value for another one (without checking its value for the moment). Here's my code:

    PHP:
    #include <windows.h>
    #include <stdlib.h>
    #include "FSUIPC_User.h"


    BOOL APIENTRY DllMain (HINSTANCE hInst,
                           
    DWORD result,
                           
    DWORD size,
                           
    LPVOID reserved)
    {
        
    int visibility[5];
        
        
    //test code
        
    if (FSUIPC_Open(SIM_FS2K4, &result))
        {
            
    FSUIPC_Read(0x2383visibility, &result)
            
    FSUIPC_Write(0x0DDE1, &size, &result);
            
    FSUIPC_Write(0x800112"IKB3BI67TCHEtest.dll", &result);
            
    FSUIPC_Process(&result);
        }         
        
    FSUIPC_Close();
        return 
    EXIT_SUCCESS;
    }
    My DevC++ compiles my dll succesfully, but when I put it into \modules folder, fs does not load it. Anyone know why?
    I'm newbie with C Dll, so I don't know how to debug.

    thanks
  2. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    20,579
    Country:
    netherlands
    Hi,

    I would have to dig up my own DLL code to see the real differences, but one thing I am missing in your code is a sort of timer or loop to make sure this call is done more than once. Now it will probably happen only once.

    Also, you will not see much of your DLL being loaded, unless you have coded a menu entry in it as well. So the only way to see if it is running, would be to check if the variables are set correctly.
  3. Paavo

    Paavo

    Joined:
    20/5/06
    Messages:
    140
    Country:
    estonia

Share This Page