|
VBScript is an untyped language, or more correctly all types in VBScript are VARIANT.
The problem is not in your VBScript, it is in your ATL method definition. To pass an array of any type into an ATL COM object from VBScript, you have to make several changes:
1) The parameter must be declared as [in, out] to force it to be passed ByRef instead of ByVal.
2) The parameter must be declared as a VARIANT* type.
3) You have to write additional code in the ATL function to convert the VARIANT* array into a byte array.
So, your new function definition must be:
"HRESULT test([in, out] VARIANT* aaa);"
Once you have passed the array into the ATL COM object you need to access it as a SAFEARRAY and retrieve the values as VARIANTS then cast them to bytes.
For more info see:
http://support.microsoft.com/kb/218454/EN-US/[^]
Robert
|
|
|
|
|
Hi,
I've got a COM component that needs to read/write browser cookies (the component is on the client machine and does not run in the context of an IE Toolbar or the like). Are there any API's available to do this or will I need to roll my own?
Thanks in advance,
-Robin
|
|
|
|
|
You probably want InternetGetCookie[Ex] and InternetSetCookie[Ex].
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
That does the trick, thanks!
|
|
|
|
|
RCox wrote:
does the trick
sdgsdfgdgdfgdfgdfgdgd
|
|
|
|
|
How can i get cookie expiration date?
|
|
|
|
|
What is the difference between COM, ActiveX and DLL ?
|
|
|
|
|
A DLL is a Dynamic Link Library. This is a binary file, that can contain almost anything: methods, resources (menus, Dialogs, images, and so forth), and, of course, references to other DLLs.
COM is the binary standard for programatically creating components (in any language). Go to the Microsoft COM page for more information on this subject.
ActiveX is a Microsoft designation for components that are created using the COM technology.
My answers given here are vastly simplified versions of what you can find at the offocial Micorosft Site. But, they are all very important (so, read, read, read until your brain is full).
|
|
|
|
|
I've a MTS/COM+ component (COMPONENT_1) that #import s ADO library. And, I have another MTS/COM+ component (COMPONENT_2) that #import s this component (i.e. COMPONENT_1). I need to use ADO objects in my second component (COMPONENT_2) too. If I use #import in my second component, I get lots of errors. If I do not, the MIDL compiler remains unable to recognize _Recordset data type.
Or, lets say that I do not use ADO in my second component at all i.e. I use IDispatch instead of _Recordset pointers to receive recordsets. This solves the problem but gives birth to a new problem. ADO recordsets loose their current position i.e. it moves to the first record if type casted to IDispatch pointers. I dont know why.
Can anyone please show me how to do it? I am using ATL with Visual C++ 6.0 SP5.
Thanks
Gurmeet BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
|
hi!
i have tried to store bitmap image into my activex control. i used the following Put property to store image.
[propput, id(7), helpstring("property CompanyLogo")] HRESULT CompanyLogo([in] IPictureDisp * newVal);
and in it i wrote following four lines of code.
m_pCompLogoDisp = newVal;
SetDirty(true);
SendOnDataChange();
FireViewChange();
The property is receiving image data but not persisting it.
does my property declarion incorrect. if so then plz help me.
Thanks in advance.
|
|
|
|
|
Hi,
I am learning COM, please provide me some documents for Biggners.
Anil
|
|
|
|
|
http://www.codeproject.com/com/COM_from_scratch_1.asp
Just started studying COM, this one seems one of the best I found (if not the best at all).
The article requires C++ knowledge, since code it contains sample in C++.
|
|
|
|
|
Me: looking to fill Senior VC++, COM, UI programming position in NYC.
You: Fantastic programmer looking for interesting position in NYC.
Please send me a resume.
|
|
|
|
|
|
Hi,
I have a customized list control which was developed by subclassing CListCtrl. I have a class derived from CListCtrl. I wish to create an activex list control using this class. I tried to create an MFC ActiveX Control. But the control class is derived from COleControl and any attempt to have multiple inheritance results in ambiguity. I do not have prior knowledge in activex.
Can you please explain how I can do it? I have no prior experience in creating activex controls.
<blink>Aravindan Premkumar
Life is short, enjoy it with a smile as long as it lasts.
|
|
|
|
|
I create a simple ActiveX control using MFC wizzard and add
a simple method "testdlg" to show a test messagebox.
Insert this control into a html using <object> tags, then using vbscript "obj.testdlg" to call the method, it does work and show the test messagebox.
But when I using these vbscript code without <object> tags
"
Dim obj
Set obj = CreateObject("progid")
obj.testdlg
"
it doesn't work.
What's more, I have tried these code in VB, it can also work.
I have to use the ActiveX control in a scripting environment
which only supports vbscript (exclude html).
So can anyone handle this problem?
I really appreciate for your help!
|
|
|
|
|
I was just curious: This is for a scripting system like Windows Based Script Host? What kind of errors, if any, are you getting?
|
|
|
|
|
i have created an activex control using COM/ATL and then i placed my activex control into Word document using following
function.
CComVariant varClsType("Ascertia.AscertiaObj.1");
MSWord::InlineShapePtr MyObj =
m_pWordApp->Selection->InlineShapes->AddOLEObject(&varClsType);
Now my activex control has different get and set properties like Caption,
BKColor,MyData etc. I want to access and modify those properties after executing the above 2 lines of code from within MSWord.
anybody there to give me a hand.
Thanks in advance.
Ahmad Jalil Qarshi
|
|
|
|
|
After complete a componet ,how will I register a component? Is there the tool in VS6.0?
|
|
|
|
|
|
It depends on the type of server you are making. If it is an in-process server (dll), at the command prompt you would type "regsvr32 filename.dll" (to unregister, you would use the '/u' switch prior to the filename.) If it is an out-of-process server (exe) then you would type "filename.exe /regserver" (to unregister, use "filename.exe /unregserver"). Hope that helps.
-Erik
|
|
|
|
|
Hello,
I've developed a COM object which is using a CSocket object to connect to a server. I'm using this COM object from an ASP page.
The functionality is quite simple:
- enter a critical section
- create a socket and talk to a server
- exit critical section
Using the debug build of my COM object the execution is hanging when attempting to enter the critical section (probably not hanging but just waiting for the critical section to get released - which is strange because no other process/thread is in that critical section).
Using the release build of the COM object, the execution passes ok the critical section statement but it throws an exception when creating the CSocket object (oSocket.Create() function).
The exception message is "Out of memory".
I suppose here is because of some security restriction or something.
The same COM object is working fine (both debug and release builds) under IIS 5 (Windows 2000) or IIS 5.1 (XP).
Any help would be greately approciated
Sorin
|
|
|
|
|
hi,
I am learning com concepts.I read that the client creats the appartments not the com.Can any one explain this in brief.Is the client multithreading done on the client machine or the server machine.
Thanking you in advance.
Satish
|
|
|
|
|
Hello, Does Any one know how to create a movie file AVI or MPEG from JPEG or BMP file. I need to create an app that can read images from a directory and create a movie file from that? Please.... any help or pointers in the right directions
|
|
|
|