Offistart - Virtual Offices, Office Space, Business Support Services
*Home>>>Call Handling

Dll help pls(error in c++ code)?


ok here is the dll

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include "stealth.h"

DWORD dwThreadID = 0;

void MainLoop()
{
while(1)
{


Sleep(10);
}

}


BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
if(ul_reason_for_call==DLL_PROCESS_AT...
{

loadDriver("\\0001.sys",true,"0001",... Driver");
CreateThread(NULL,0,(LPTHREAD_START_... <-------
if(unlinkThread((int)dwThreadID) != 1)
{
MessageBox(0,"Invalid Operating System Detected!","Error",MB_ICONERROR);
ExitProcess(0);
return FALSE;
}

return TRUE;
}
return TRUE;
}

im using dev-c++ compiler

and im getting an error on this line
so can someone help me fix this

entire line with error is this
CreateThread(NULL,0,(LPTHREAD_START_RO...

i get these errors
In function `BOOL DllMain(void*, DWORD, void*)':

[Warning] passing NULL used for non-pointer converting 5 of `void* CreateThread(_SECURITY_ATTRIBUTES*, DWORD, DWORD (*)(void*), void*, DWORD, DWORD*)'

[Linker error] undefined reference to `WinMain@16'

ld returned 1 exit status

these are the errors ig et, and i dont no how to fix them, so can someone help plz

The problem is the signature of MainLoop. If you write MainLoop properly, you won't need the (LPTHREAD_START_ROUTINE) cast.

The thread function needs to take a pointer to void and return a DWORD.

It should look like this:
DWORD MainLoop (void * pdata)

When using function pointers, having the correct signature is required. Anything else will cause crazy errors. Feel lucky you got a compiler error. If you got it to compile, the runtime errors would be very hard to diagnose.

The pdata parameter allows you to pass context data to the thread, this way you can start off different threads with different data.

Tags
  Commercial Space   Office Space   Business Services   Business Address   Call Forwarding   Call Handling   Answering Service   Telephone Answering   Mail Forwarding   Virtual Address   Virtual Assistant   Virtual Business
Related information
  • Heightened anxiety while pregnant?

    Yes it sure sounds like the cruse of the pregnancy hormones. You should really make an appointment and talk to the doctor about it. Also look up some ideas and tips to learn to calm yourself and g...

  • Do you agree with this statement The policies of the Bush administration are designed to make life?

    It is about time that the Bush Administration got off its behind and started enforcing the laws of this country! I wish it was harder for them to sneak back over and hope that the fence is reinforc...

  • Is there a preferred/traditional handle for mother-in-law, father-in-law. Assuming a good relationship?

    If i felt loved by my in-laws, i'd definately call them mom or dad. But if they've never done anything to show me that they love me, or don't deserve to be loved, then i won'tca...

  • A father came to my daycare to pick up his children, and he was drunk...?

    I would just ask him if you could talk to him for a few minutes and tell him that your just concerned about his children, and want them to be safe. Hope i helped and God Bless!

    ...
  • Which Final Fantsy game...?

    Only Final Fantasy 7 and Crisis Core are about Cloud, Tifa, Aerith, etc. Through all the Final Fantasy games, they sometimes reuse characters with different minds, slightly different names, and a s...

  • Crying ex-girlfriend?

    If you don't want to be in a relationship with her any longer, she should not be pushing you into it. I know it's hard to hear her cry, but you have to be strong. If you broke up with her...

  • How do you handle difficult job interview situations ?

    Explain that there must be an issue in the communication between the two of you, and attempt again. Apologize for the frustration. If there are still belittling comments made, you have every righ...

  • How Should I Handle My Husbands Lie?

    U see. Any time a husband and wife does not do something because the other insists it starts problems. Why don't you go to your trips? He has the right to go if he wants to. In fact he sho...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster