Page 1 of 2

Posted: Tue Jun 04, 2002 3:07 pm
by BackupUser
Restored from previous forum. Originally posted by GorkaTRON.

I'm confused with COM and DCOM technology. I need make an application with a Quickcam and I have seen that Logitech has got a SDK with a COM object but I don't know if it's possible access with Purebasic, perhaps I have to use CallCOM, but I'm not sure because this command is not in help.

COM objects are ActiveX, isn't it? And COM can be OCX and DLL, which is the difference?

Thanks

Posted: Wed Jun 05, 2002 10:11 am
by BackupUser
Restored from previous forum. Originally posted by GorkaTRON.

Plz Danilo and El_Choni help me. I believe you know how get this.

Thanks in advance.

Posted: Wed Jun 05, 2002 10:52 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

Where can someone find the Logitech SDK you want to use ??

cya,
...Danilo

(registered PureBasic user)

Posted: Wed Jun 05, 2002 1:04 pm
by BackupUser
Restored from previous forum. Originally posted by El_Choni.

Hi Gorka, I'd like to help you, but my knowledge in COM almost equals to zero. Maybe Danilo can help you.

Bye,



El_Choni

Posted: Wed Jun 05, 2002 3:36 pm
by BackupUser
Restored from previous forum. Originally posted by GorkaTRON.

Hi Danilo.

You can download the SDK in http://developer.logitech.com

It's free.

Thnks.

Thanks El_Choni too.

Bye

Posted: Thu Jun 06, 2002 7:44 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

Cant figure it out without a camera.
Can you send me a "Logitech QuickCam® Pro 3000" please ??

Ummm... better forget this for now.

cya,
...Danilo

(registered PureBasic user)

Posted: Thu Jun 06, 2002 10:31 am
by BackupUser
Restored from previous forum. Originally posted by GorkaTRON.

Yes Danilo. I can send you a QC PRO 3000 but if you pay it.

SDK has 3 PDF manuals: 1 for MFC, 1 for VC++ and 1 for Visual Basic. I think this will be enough for you because you are a xperienced programmer.

Thanks for your comments.

Ciao.

Posted: Thu Jun 06, 2002 11:08 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

>I can send you a QC PRO 3000 but if you pay it.

LOL
No, thanks. I could buy it at the local store,
but i dont need a camera for me at this time.
It would only help with testing the stuff.

>SDK has 3 PDF manuals:

I know, i read it.

>I think this will be enough for you

I cant write new stuff (PureBasic and COM)
totally blind (well, i cant test it).
Have you looked at the manuals and at the
C/C++ Code ?? Looks crazy...

When you write new stuff that nobody has done
before, you have to test every few lines of code.
In C/C++ (and VB even more) lowlevel COM/ATL stuff is
hidden from the programmer, so you cant only translate
1 by 1...

Frederic will implement COM/ActiveX/ATL/OLE/whatever.
Right, Fred ??

Posted: Thu Jun 06, 2002 12:48 pm
by BackupUser
Restored from previous forum. Originally posted by Rings.

use VB!

Its a long way to the top if you wanna .....CodeGuru

Posted: Thu Jun 06, 2002 7:34 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

> use VB!

But there's a lot useful ActiveX controls that would be nice to use with PureBasic.
I know PureBasic VB, but by that logic we shouldn't use DLLs with PureBasic
either...


PB - Registered PureBasic Coder

Posted: Thu Jun 06, 2002 7:51 pm
by BackupUser
Restored from previous forum. Originally posted by GorkaTRON.

I think use VB is not a solution because I can not change programming language in each project. VB is expensive, slow, I don't like it. I prefer use PureBasic and make my dll libraries in this language.

Thks

Bye

Posted: Thu Jun 06, 2002 9:03 pm
by BackupUser
Restored from previous forum. Originally posted by PB.
I think use VB is not a solution because I can not change programming language in each project. VB is expensive, slow, I don't like it. I prefer use PureBasic and make my dll libraries in this language.
You don't understand: we don't want to *make* ActiveX controls in PureBasic; we
want to be able to *use* them, just like we can use third-party DLLs. Using an
ActiveX doesn't mean you need to install Visual Basic; you only need the ActiveX
control itself, which can be a file of any size, depending on its function.

PB - Registered PureBasic Coder

Posted: Fri Jun 07, 2002 6:33 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

The big Problem with OOP is only the init part.

There are the names COM, ActiveX, OLE, ATL and
for sure some more.
Many different names for the same goal.

"CallCOM()" is for calling a method in a COM
object, so it should work with all this
different things.

I looked at the Logitech SDK and i have seen
that i can use CallCOM() to call the Methods
in the Object. So its possible to display
the camera image, make a screenshot and much
more things.
The problem is "only" (LOL ) the init part.

I can figure out the things very often, when
i have C-Code. So i can translate it to PureBasic
and to Assembly (DirectX, COM).
C++ and VB hide all the (not easy) init stuff.
(thats a very good thing for the HighLevel coder,
but LowLevel coders cant get infos about it easily.)

Another problem in this case:
You need a camera to run the examples.
I cant start the compiled examples in the SDK,
because there is no camera attached to my PC.

From the SDK docs:
"However, instantiating an ATL COM object without
MFC is not quite so simple."

Logitech is right. They know what i think...

Here my little test.
MsgBox shows 0 every time, so it doesnt init
correctly. As long as this is 0 you cant use
CallCOM(). CallCOM() with 0 = crash.

Why does it not init correctly ?? Is it because
i dont have the camera connected and the driver
isnt installed correctly ??

I think thats the reason.
Cant write it without camera, but you´ll figure
it out yourself. Sorry.

Code: Select all


Declare InitializeVideo(hWnd)
Declare UnInitializeVideo()


#PrepareControl = 28
#ConnectCamera2 = 60
#put_EnablePreview = 60 + (47*4)


CoInitialize_(0)
If OpenLibrary(1,"ATL.DLL")
   If CallFunction(1,"AtlAxWinInit")
      beep_(1400,500)
       ;OpenLibrary(2,"VPortal2.dll")
       ;CallFunction(2,"DllRegisterServer")
         hWnd = OpenWindow(1,10,10,640,500,#PB_Window_SYSTEMmenu,"No Camera Test :wink:")   
         InitializeVideo(hWnd)


         MessageRequester("INFO",StrU(Camera,2),0)


         Repeat
         Until WaitWindowEvent() = #PB_EventCloseWindow
         ;UnInitializeVideo()


       CallFunction(1,"AtlAxWinTerm")
       ;CallFunction(2,"DllUnRegisterServer")
   EndIf
   CloseLibrary(1)
   ;CloseLibrary(2)
EndIf
CoUnInitialize_()
End


Procedure InitializeVideo(Parent)
Shared Camera
           StringMem = AllocateMemory(1,1000,0)
            ;StringFromCLSID_(?CLSID_VideoPortal, StringMem) ; strGUIDVideoPortalActiveXControl
           x = StringFromGUID2_(?CLSID_VideoPortal,StringMem,1000)
            ;StringMem = PeekL(*StringMem)
           strGUIDVideoPortalActiveXControl.s = PeekS(StringMem)
           ;MessageRequester("INFO",strGUIDVideoPortalActiveXControl+Str(x),0)


           ;strGUIDVideoPortalActiveXControl.s = "{102225E5-EA25-11D3-886E-00105A154A4D}"
           hWndCtl = CreateWindowEx_(0,"AtlAxWin", strGUIDVideoPortalActiveXControl,#WS_CHILD | #WS_VISIBLE | #WS_GROUP, 0, 0, 400, 400, Parent, 0, GetModuleHandle_(0),0)
           CallFunction(1,"AtlAxGetControl",hWndCtl,@Camera)


           ;CallCOM(#PrepareControl,Camera,0,0,0,@Result)
           ;CallCOM(#ConnectCamera2,Camera,@Result)
           ;CallCOM(#put_EnablePreview,Camera,#TRUE)
EndProcedure


Procedure UnInitializeVideo()
EndProcedure


DataSection


CLSID_VideoPortal:
; CLSID_VideoPortal = {0x102225E5,0xEA25,0x11D3,{0x88,0x6E,0x00,0x10,0x5A,0x15,0x4A,0x4D}};
Data.l $102225E5
Data.w $EA25, $11D3
Data.b $88,$6E,$00,$10,$5A,$15,$4A,$4D


IID_IVideoPortal:
;IID_IVideoPortal = {0x102225E4,0xEA25,0x11D3,{0x88,0x6E,0x00,0x10,0x5A,0x15,0x4A,0x4D}};
Data.l $102225E4
Data.w $EA25,$11D3
Data.b $88,$6E,$00,$10,$5A,$15,$4A,$4D


strGUIDVideoPortal:
Data.w 123
      ; 1  0  2  2  2  5  E  5  -  E  A  2  5  -  1  1  D  3  -  8  8  6  E  -  0  0  1  0  5  A  1  5  4  A  4  D
Data.w 49,48,50,50,50,53,69,53,45,69,65,50,53,45,49,49,68,51,45,56,56,54,69,45,48,48,49,48,53,65,49,53,52,65,52,68
Data.w 125, 0,0    ;{102225E5-EA25-11D3-886E-00105A154A4D}


EndDataSection
cya,
...Danilo



Edited by - Danilo on 07 June 2002 08:03:25

Posted: Fri Jun 07, 2002 7:08 am
by BackupUser
Restored from previous forum. Originally posted by GorkaTRON.

Thanks Danilo.

If I am not wrong there are methodes and properties in a COM,
I suppose methodes can be called by CallCOM and how can
I change properties.

On the other hand, how I can get GUID, CLSID...? With ComSlicer?
Or with ComWizard?

Bye

Posted: Fri Jun 07, 2002 7:21 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

>On the other hand, how I can get GUID, CLSID...? With ComSlicer?
>Or with ComWizard?

Read the C/C++ header from the SDK.
Everything is in the header files.

Thats it.