mIRC Home    About    Download    Register    News    Help

Print Thread
#22255 04/05/03 02:04 PM
Joined: Apr 2003
Posts: 8
S
sNif Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Apr 2003
Posts: 8
I think everybody knows that mIRC have DLL support. I have done my dll's already, but one problem. It takes too long to search data. Sametime mIRC stops "running" when this DLL searchs data. So I read about this "Keep-DLL-Loaded after load". Can someone demonstrate this with some code? Yes I have already read that mIRC help, and used that code, but that code didnt work.

I know this is mIRC forum not c/c++ developers forum. But i think this DLL support is for C/C++.

Last edited by sNif; 04/05/03 02:11 PM.
#22256 04/05/03 05:01 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
If you tell mIRC to keep the dll loaded it will not prevent your dll from locking up mIRC (unless you make your dll threaded which probably isn't a good idea). But basically all you do is include a LoadDll function like the one documented in the help file:

void __stdcall (*LoadDll)(LOADINFO*);

typedef struct {
DWORD mVersion;
HWND mHwnd;
BOOL mKeep;
} LOADINFO;


You then set the LOADINFO->mKeep to TRUE. This will force mIRC to keep the dll loaded rather than unloading it as soon as it finishes.

#22257 06/05/03 07:07 PM
Joined: Dec 2002
Posts: 44
P
Ameglian cow
Offline
Ameglian cow
P
Joined: Dec 2002
Posts: 44
The best way to prevent this from happening, is to perform self recursion.

By the sounds of it, you are stepping through a rather large loop. Go with me now, I don't know C that well, but you should see the idea.

Pass it a parameter of where we are up to, and in this example, call it x. We call this "function1"
i = 1
while (i <= 10)
{
y = Perform_function_based_on_value(x);
i++;
}
if (y = E_COMPLETE)
{
#send data, based on the fact our search is comeplete
} else {
x++
#Using a 1 second timer (call it via mIRC), re-call function 1, with a new value for x
}

This will pass control to mIRC for brief periods, allowing it function without locking (in theory).


Suck it, lick it, milk it then put it away.
#22258 11/05/03 12:03 AM
Joined: Apr 2003
Posts: 8
S
sNif Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Apr 2003
Posts: 8
Hmm... It's possible to return value to mIRC and keep it loaded?

like:
void __stdcall (*LoadDll)(LOADINFO*);

typedef struct {
DWORD mVersion;
HWND mHwnd;
BOOL mKeep;
} LOADINFO;

int __stdcall test(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL print, BOOL nopause) {
_fstrcpy( data , "hello" );
return 3;

LoadDll -> mKeep = TRUE; ??
}

or? im not sure about that LoadDll

Last edited by sNif; 11/05/03 12:03 AM.
#22259 11/05/03 04:36 PM
Joined: Dec 2002
Posts: 44
P
Ameglian cow
Offline
Ameglian cow
P
Joined: Dec 2002
Posts: 44
Keepign the DLL loaded is not a issue.

What is on about, is mIRC locking when he goes into a deep or nested loop.

When you call a dll command, mIRC will not regain control, until the command is complete. The idea is to find some way tpo prevent this.


Suck it, lick it, milk it then put it away.
#22260 11/05/03 05:15 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well based on what you pasted there, I don't personally think you know enough C/C++ to be writing a DLL. There are 3 things that have member data variables, structs, unions, and classes. Not functions. Yet you are trying to access a member data variable of a function, thats not going to work. If you want to write a DLL you need to know C/C++.

#22261 13/05/03 04:33 PM
Joined: Apr 2003
Posts: 8
S
sNif Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Apr 2003
Posts: 8
I'm programmed with C/C++ more than years. I started to programming with Unix platforms, so my Win32 programming (DLL,APIs,COM+,etc.) is not so good.

So what im trying to do is a kind remote-console for mIRC using OpenSSL etc. Problem is i dont wana do it by remote script. I want do it by using DLL so its MUCH easier to do different functions.

Remote-console's thread will stops the mIRC i while, but by using select its another thing. I don't need even loop-threads.

I cant find any examples/demonstrations about this. So can someone please tell me more about that. [intrested]


Link Copied to Clipboard