COMate - control COM objects via automation - OBSOLETE!

Developed or developing a new product in PureBasic? Tell the world about it.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Well then I suspect a mix up with the parameters or paramater types.

Use COMate_GetLastErrorDescription() to get an idea what the problem might be. If that doesn't help then equip yourself with some kind of OLE viewer so that you can drill down into the object's methods to look at the parameters etc.
I may look like a mule, but I'm not a complete ass.
User avatar
Kiffi
Addict
Addict
Posts: 1484
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Post by Kiffi »

Code: Select all

KCC_Code = ReplaceString(KCC_Code, "AS COMate object", "AS COMateObject")
;-)

Greetings ... Kiffi
Hygge
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

:lol:

Whoops...
I may look like a mule, but I'm not a complete ass.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

YEEEEEEEESSSSSS !!!!!!
KIFFI as win
:D

It's funny how you have explain to me :lol:

Thanks,Thanks,Thanks,Thanks,Thanks,Thanks,Thanks,Thanks,Thanks,Thanks,Thanks,Thanks,Thanks,Thanks,Thanks,Thanks :D

I have forgotten Thanks,Thanks,Thanks,Thanks :lol:
I love you all :D

That's works

Well now again this important part not works.
It's for sending a document join

Code: Select all

 ; documents joint 1 
  Define bodyAtt.COMateObject 
  Define bodypart.COMateObject ; Added by KCC
 
  If Len(Attachment1) > 0  
   If FileSize(Attachment1) > 0 
    bodyAtt = bodypart\GetObjectProperty(Str(#EMBED_ATTACHMENT) + ", '', '" + Attachment1 + "', '" + Attachment1 + "'") 
   EndIf 
  EndIf 
  
ImageThe happiness is a road...
Not a destination
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

bodypart has not been initialised!!! (As I explained before!)
I may look like a mule, but I'm not a complete ass.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Yes yes my good SROD.
Keep cool :lol:
I understand quickly, but you must explain me a long time :oops:

This is this sentence that i do translate, right ???

Code: Select all

Set bodypart = beDoc.CREATERICHTEXTITEM("Body") 
ImageThe happiness is a road...
Not a destination
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Well, what is beDoc - where is that defined in your PB code? I see it in the VB code...

Code: Select all

bodypart = beDoc\Invoke("CREATERICHTEXTITEM('Body')") 
I may look like a mule, but I'm not a complete ass.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Thanks SROD
I have not again at the top, because me i have write this :lol:

Code: Select all

bodypart\Invoke(Str(MailDoc) + " AS COMateObject \ CREATERICHTEXTITEM('Body'))
I have again an error invalid memory with this code

Code: Select all

; documents joint 1 
  Define bodyAtt.COMateObject 
  Define bodypart.COMateObject ; Added by KCC
  bodypart = MailDoc\Invoke("CREATERICHTEXTITEM('Body')") 
 
  If Len(Attachment1) > 0  
   If FileSize(Attachment1) > 0 
    bodyAtt = bodypart\GetObjectProperty(Str(#EMBED_ATTACHMENT) + ", '', '" + Attachment1 + "', '" + Attachment1 + "'") 
   EndIf 
  EndIf 
ImageThe happiness is a road...
Not a destination
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Sorry my mind is elsewhere at the moment.

Code: Select all

bodypart = beDoc\GetObjectProperty("CREATERICHTEXTITEM('Body')") 
or

Code: Select all

bodypart = MailDoc\GetObjectProperty("CREATERICHTEXTITEM('Body')") 
Whichever one you need.
I may look like a mule, but I'm not a complete ass.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Yes yes i have correct that alone, it's a miracle no ????? :lol:
It is the fault at Kiffi, he changed the names of variables, I'm lost, ugly kiffi :lol: :lol: :lol:

In my mean, the problem is to translate this line

Code: Select all

Set bodyAtt = bodypart.EmbedObject(EMBED_ATTACHMENT, "", Attach1, Dir(Attach1)) 
You have translated to this

Code: Select all

bodyAtt = bodypart\GetObjectProperty(Str(#EMBED_ATTACHMENT) + ", '', '" + Attachment1 + "', '" + Attachment1 + "'") 
But there are an memory error on this line :cry:
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Perhaps the world ".EmbedObject" missing no ????
ImageThe happiness is a road...
Not a destination
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Code: Select all

bodyAtt = bodypart\GetObjectProperty("EmbedObject(" + Str(#EMBED_ATTACHMENT) + ", '', '" + Attachment1 + "', '" + Attachment1 + "')") 
I may look like a mule, but I'm not a complete ass.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

I did not say a big stupidity :D
It's really the ".EmbedObject" missing
I'm not a big donkey, i just a little donkey :lol:

I have always an error of memory this your last line :cry:
ImageThe happiness is a road...
Not a destination
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

I have no idea - check the value of bodypart.
I may look like a mule, but I'm not a complete ass.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

If i ask VB debugger what is the value of bodypart.name, he said to me "Body" and for bodyAtt.name, he said to me the name of the join piece :shock:
Last edited by Kwai chang caine on Wed Nov 19, 2008 3:01 pm, edited 2 times in total.
ImageThe happiness is a road...
Not a destination
Post Reply