Shoutbox

problem with loading objects in plugin - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: problem with loading objects in plugin (/showthread.php?tid=12557)

problem with loading objects in plugin by Xerxis on 07-08-2003 at 11:40 AM

i'm having a bit of a problem

the thing is loading an object in parsecommand will cause the command not to be parsed while the object is loaded

for example

Public Function ParseCommand(ByVal sCommand As String, ByVal sCommandArg As String, ByVal oConversationWnd As Object, ByRef sResult As String) As Boolean
    If (StrComp(LCase(sCommand), "/xwmp", vbTextCompare) = 0) Then
        sResult = ""
        ParseCommand = True
        load(form1)
        Exit Function


...

and so on

will cause this, anyone who knows how to work around this?


RE: problem with loading objects in plugin by Xerxis on 07-08-2003 at 11:56 AM

I already tried

Set frm = New Form1
    frm.Show
    Set frm = Nothing

but that gives the same problem
so i'm getting a bit desperatie, because it's not only with forms

i'm starting to fear that the only thing i can do is to start a second thread, but that means making another dll with the forms or doing a lot of code in vb6. so i'm probably just overlooking a very simple solution (at least that's what i hope ;))


RE: problem with loading objects in plugin by Xerxis on 07-08-2003 at 01:44 PM

oh c'mon, somebody has to know a solution. i already put a lot of work in my plugin and it works as a standalone exe (well kind of) i don't want to give up now because i can't open my classes :s


RE: problem with loading objects in plugin by Bamboe on 07-08-2003 at 01:47 PM

i want to know how you do this in c so can somebody tell us???


RE: problem with loading objects in plugin by Xerxis on 07-08-2003 at 02:06 PM

the problem with vb is that the loading of an object will stop the rest of the code to stop until the object is released again, i don't know how to bypass this, i just tried it by using a second dll but that doesn't help. then i made a second thread which worked (it only had one little problem, it made msn crash :d) so now i'm out of ideas, the only thing left over that i know off is making an exe and calling that with command line arguments out of your dll, which seems pretty lame to me :s


RE: problem with loading objects in plugin by surfichris on 07-08-2003 at 02:15 PM

Form1.Show?

Form1.Visible = True?

Have you tried those?


RE: problem with loading objects in plugin by Bamboe on 07-08-2003 at 02:29 PM

Form1->Show(); didn't work and my form is standard visible


RE: problem with loading objects in plugin by zigomar10 on 07-08-2003 at 02:56 PM

this also happens to me when i make a message box :wall:


RE: problem with loading objects in plugin by Bamboe on 07-08-2003 at 02:59 PM

No a messagexox works when you make him like this: MessageBox(NULL, "Hello World", "Hello", MB_OK);


RE: problem with loading objects in plugin by zigomar10 on 07-08-2003 at 03:12 PM

how would you make an equivalent to this:

code:
If MsgBox("Blabla", vbYesNo, "blabla") = vbYes Then
Else
End If


RE: problem with loading objects in plugin by surfichris on 07-08-2003 at 03:14 PM

I was talking about visual basic...

You will have to await on a reply for patchou about C++


RE: problem with loading objects in plugin by Xerxis on 07-08-2003 at 03:16 PM

form.show and form.bisible first execute a load(form)
maybe if i use a callback

just the last thing i haven't tried ;)


RE: problem with loading objects in plugin by zigomar10 on 07-08-2003 at 03:18 PM

yeah, i meant VB too. so how would u make a msgbox in vb??


RE: problem with loading objects in plugin by Xerxis on 07-08-2003 at 03:22 PM

msgbox "this is a message box"

and there is no problem with that code in the plugin functions


RE: problem with loading objects in plugin by Xerxis on 07-08-2003 at 03:24 PM

alright, solved the problem, a callback works

so there was an easy solutions after all


RE: problem with loading objects in plugin by Bamboe on 07-08-2003 at 03:26 PM

this is not vb but c but i made it this way and it worked:

if(MessageDlg("test", mtConfirmation, TMsgDlgButtons()<<mbYes << mbNo,0)==mrYes) strcpy(sResult, "form geopend");


RE: RE: problem with loading objects in plugin by zigomar10 on 07-08-2003 at 03:27 PM

quote:
Originally posted by Xerxis
msgbox "this is a message box"

and there is no problem with that code in the plugin functions

that doesn't work for me
RE: problem with loading objects in plugin by Predatory Kangaroo on 07-08-2003 at 03:52 PM

really, zigo?
If i want to do a decision thing like that, i do this:
Dim result as vbMessageBoxResult
result = MsgBox("Text", "Title", vbYesNo)
if result = vbYes then
'do this
else
'do that
end if


RE: problem with loading objects in plugin by zigomar10 on 07-08-2003 at 04:06 PM

good idea, but for me, even:
MsgBox "Hello, I am mr. messagebox"
doesnt work when making a plugin


RE: problem with loading objects in plugin by Patchou on 07-08-2003 at 05:18 PM

I'm not sure I understand your problem.. I tried to call MsgBox sevral times when I was testing and it worked fine. As long as your function is declared correctly, what is inside only concerns VB, not Plus!. I'm sorry I can't give you more help, I'm not a vb developer :p


RE: problem with loading objects in plugin by Bamboe on 07-08-2003 at 05:24 PM

Patchou, the problem is that we don't know how to create an object like a new form in c and in vb, could you please explain to us with an example how we create a new form in c???


RE: problem with loading objects in plugin by Xerxis on 07-08-2003 at 06:05 PM

in vb when using the messenger plus api if you want to call a form you have to do it like this

Form1.Show vbModal, Screen.ActiveForm

in c you can use the mfc, if you have visual c this shouldn't be too difficult


messageboxes in vb can't be a problem :s


RE: problem with loading objects in plugin by Bamboe on 07-08-2003 at 06:26 PM

I have borland c++ 6 and i don't know what MFC is (asked in this thread before what a MFC is). Form1->Show(); and ShowModal(); don't work. So can somebody explain it to me?


RE: problem with loading objects in plugin by Xerxis on 07-08-2003 at 07:44 PM

MFC

microsoft something something well it let's you program for ms windows very fast and easy, you don't have to write the code for your forms and so on by yourself.