What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » About Initialize()

Pages: (2): « First [ 1 ] 2 » Last »
About Initialize()
Author: Message:
Whacko
Full Member
***

Avatar

Posts: 209
Reputation: 1
40 / Male / –
Joined: Apr 2002
O.P. About Initialize()
Patchou... i hope you're reading this.

in v2.20.51 you changed the plugin support a little bit by using a different thread for them. I Quote:

There are two modifications: first, Initialize() is called in a different thread. It is synchronised with the main thread, you shouldn't have to worry about it but well, you never know...  the second modification is a protection: if you messed with the header file distributed with the API package and your function is not compiled with __stdcall anymore, Plus! will block your plugin so no function after Initialize() will be called.


ok I understand why you did it... but doesnt it make the Initialize() function useless?? i cant initialize in that function anymore cos all get destroyed when the thread is closed.
So.. wouldn't it be a better idea to run the ENTIRE plugin in the other thread? Cos if something is wrong in another function it could still mess up. :)

To initialize my values now.. i have to do it when one of my other functions are called. which is kinda messy IMHO.

hope you understand what i mean :) furthermore.... keep up the fgood work :bow:
I code in:
C
C++
Delphi
Visual Basic
Pascal :P
07-13-2003 07:33 PM
Profile PM Web Find Quote Report
Derusc
Junior Member
**

Ð3®µ$|<

Posts: 20
40 / Male / –
Joined: Jul 2003
Status: Away
Wink  RE: About Initialize()
I'm agree too
07-21-2003 04:48 PM
Profile E-Mail PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: About Initialize()
Well, I have to say I don't understand what you problem is. When you initialize yoru variables, it maybe in a different thread but it's in the same process. Nothing will be destroyed when the thread exits. Can you give me more explanation about the problems your experiencing? (with a code snippet maybe).

Thanks,
Patchou
[Image: signature2.gif]
07-21-2003 10:50 PM
Profile PM Web Find Quote Report
Derusc
Junior Member
**

Ð3®µ$|<

Posts: 20
40 / Male / –
Joined: Jul 2003
Status: Away
Roll Eyes  RE: About Initialize()
Sorry i thought  thread wasn't in the same process. and thread will be destroyed.


Sorry
07-22-2003 07:09 AM
Profile E-Mail PM Find Quote Report
Whacko
Full Member
***

Avatar

Posts: 209
Reputation: 1
40 / Male / –
Joined: Apr 2002
O.P. RE: About Initialize()
Well, Im using delphi for my plugins btw. if i create a form in the Initialize() function, after the function is finished, the form is destroyed. So i cant show it after that anymore, i'd have to create it again. Maybe just a Delphi thing... or me coding really noobish :P but thats the problem :P
I code in:
C
C++
Delphi
Visual Basic
Pascal :P
07-22-2003 09:54 AM
Profile PM Web Find Quote Report
mrhuge
Junior Member
**

Avatar

Posts: 88
Reputation: 5
46 / Male / –
Joined: May 2003
RE: About Initialize()
Hmm, it seems like you're coding it like this:
code:
function Initialize([params]): boolean
var frmForm : TfrmForm;
begin
frmForm = TfrmForm.Create(nil);
end;

This way the form will be deleted after Initialize finishes. When you declare frmForm as a global variable, it won't be deleted.
07-22-2003 10:02 AM
Profile PM Find Quote Report
Whacko
Full Member
***

Avatar

Posts: 209
Reputation: 1
40 / Male / –
Joined: Apr 2002
O.P. RE: About Initialize()
no :P

code:
var frmmanager : TFrmmanager;

function initialize(params):boolean;
begin
  Application.CreateForm(TfrmManager, frmManager);
  result := true;
end;



This post was edited on 07-22-2003 at 01:14 PM by Whacko.
I code in:
C
C++
Delphi
Visual Basic
Pascal :P
07-22-2003 01:14 PM
Profile PM Web Find Quote Report
mrhuge
Junior Member
**

Avatar

Posts: 88
Reputation: 5
46 / Male / –
Joined: May 2003
RE: About Initialize()
Have you tried doing
code:
frmmanager := TFrmmanager.Create(nil);
in stead of
code:
Application.CreateForm(TfrmManager, frmManager);
Maybe that helps.
07-22-2003 01:21 PM
Profile PM Find Quote Report
Whacko
Full Member
***

Avatar

Posts: 209
Reputation: 1
40 / Male / –
Joined: Apr 2002
O.P. RE: About Initialize()
no i use Application.Createform() cos i want Msgplus to be its creator... else it doesnt show when i use Form.show.
I code in:
C
C++
Delphi
Visual Basic
Pascal :P
07-22-2003 03:21 PM
Profile PM Web Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: About Initialize()
ok I see... well, I'll have to think about a way to go around the problem. Thanks.
[Image: signature2.gif]
07-22-2003 03:33 PM
Profile PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On