|
I forgot to mention that each COM+ application needs to start in it's own thread.
Kevin
|
|
|
|
|
Hi, I'm a vb6 programmer and want to learn COM programming. My previouse experience is working vb6 and database (such as access or sql server). I want to learn COM by using vb6 programming language. I would like to ask you two questions:
1. Is it possible to learning COM with vb6 programming language? I don't like to use c++, I prefer vb6 because it is easier.
2. Are there any resource to learn COM programming from the beginner?
Please give a comment or suggestion to me
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Hi ,
U can learn COM programming using VB6 itself. but to understand COM in depth , u need to learn it in C++ . VB hides lot of details from u.
There is something called ActiveX DLL and ActiveX projects in VB6. if u create an ACtiveX DLL or ActiveX EXE project, and write a VB6 class module,
ur one ur way to create a COM object. One can invoke the classes u created in VB6 from C++ or Delphi.
To understand COM in VB , Try to learn what implements keyword does. Try to
read as much as possible. Then there are things like
Automation and IDispatch interface
Dual interface
Explore what is the difference between
Dim x as new ADODB.Command
and
Dim x as object
set x = CreateObject("ADODB.Command")
if u want to create COM objects for ASP which should run at the session scope , ur out of luck with VB. But , if u learn all about implements keyword , writing aDdins etc , u will have good overview of COM.
There is a book by Apress by the name VC++ for VB Programmers . Try to read it .
Hope this helps
Praseed Pai
www.praseedpai.com
|
|
|
|
|
Thank you very much for your idea. I'm fimilar with VB6 but very difficult to learn c++. I used to learn c++ but it seem that it is a very difficult programming than vb6. What I want to do is working with COM programming more deeply with vb6. Thank you very much for your advices!!
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
VB6 programming language entirely may develop COM ,but also simple and quickly. The resource really is not a problem to a programmer , the network is so large , and takes a little time then you 'll gain a lot of infomation.
thank u
|
|
|
|
|
I'm programming a little software with MATLAB. I would like create a heading "help". I suppose that I must include an activeX but I don't know it.
Any help will be appreciate.
thanks
fredf
|
|
|
|
|
What is the best way to get an IStream interface pointer on an existing file? I am using Visual C++ 6.0.
Man Learns from History that he never learns from History
|
|
|
|
|
AFAIK, there is no known implementation for files. I implemented it myself, which is pretty straight forward.
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
I found the SHCreateStreamOnFile function. Was wondering if there was somthing in the STG group of functions that I could use.
Man Learns from History that he never learns from History
|
|
|
|
|
Hey, thanks for the function. I haven't seen it before, and certainly not in the STG headers.
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
I have one module in Labview and other one in MFC ,how i could integrate MFC with Labview.
|
|
|
|
|
i have used [in,out] in my COM method but when i call my method from ASP it gives error "Type mismatch: methodname" . i have also used CInt() for my int variables , but now it shows nothin when i respons.write my variable.
e.g
In COM
power([in]int num,[in] int pNum,[in,out] int *res)
In ASP , i calling it
myObj.power num1,num2,CInt(num3) 'this gets nothin in num3
if i go like that
myObj.power num1,num2,num3 'gives error Type Mis-match:power
aby idea abt this????
|
|
|
|
|
Ok, just making sure here:
The reason you make it [in,out] is because you provide some information and expect possible different information back, right ?
If not, if all you want is to return a value, you should use [out] only, althought for int values it shouldnt make much of a difference. If you return only 1 value, i suggest you use [out, retval], in which case, you can assign to a variable like: var = myObj.power(num1, num2).
If you use CInt(num3), ASP actually creates a new, invisible, variable to store the conversion and your returned value isnt accessible, even if it is actually returned somewhere.
what you might also need is the equivalent of addressof(var), or &var in your script engine. so you might have to do something like myObj.power num1, num2, addressof(num3). I'm not sure exactly if this is a requirement but i expose it just in case.
by the way, which scripting language are you using ? VBScript or JavaScript ?
|
|
|
|
|
Yes , u r right, i want to provide some info to method and get processed info from method. i have used [out,retval] , it works fine but i want to get multiple variables out of method that's y using [in,out]. i m using VB Script. well is there any addressof(var) operator exists in VB script. if so do tell me or any equivalent function to do this.
|
|
|
|
|
Hmmmmm, VBScript...
Ok, do you declare your variables before using them ?
Dim num3 as Integer
myObj.power 2, 3, num3
this should theoreticly work. Reason should be, if you dont declare your variable, the variable is defined as type Variant which is not what myObj.power expects.
|
|
|
|
|
hi
If u want to return a value back to asp from an interface method, that variable shud b of type VARIANT type. There is no other go. So the IDL shuld be [in, out] VARIANT *pOut1, [in, out] VARIANT *pOut2, ..., ... for all the variables u need to return a value back to asp. This way u can have any number of in-out parameters for an interface method.
rgds.. mil10
|
|
|
|
|
i wrote an active control using ATL,and put it in webpage,it shows
well in IE6.0 but,it can not show itself in mozilla 1.6 ,that's why?
generally says i am not familar with mozilla
thanks for any help
|
|
|
|
|
hi ,
IE is an activex control container ( As it is from MS ). Where as Mozilla is a open source initiative. Mozilla browser is not an Ax control container.
Besides Mozilla browser is x-platform browser. there is no equivalent of COM/OLE/ActiveX in linux.
Hope this helps
Praseed Pai
www.codeproject.com
|
|
|
|
|
hello !
i just want to know that a component built using STA cant be used in an MTA environment.
And if i want to do this , how this can be done?
the_sikander
|
|
|
|
|
I am looking for a tutorial on making a COM dll in VC++. I've searched Code Project articles and the web at large without success.
Can anyone point me toward a resource?
<signature>
It's good to live,
Josef Wainz
Software Developer
|
|
|
|
|
|
Thanks for the article pointer. I still find the Code Project menus less than intuitive. I did a search on articles with the criteria of 'COM dll tutorial' and no articles were found.
I spend so much time here, I need to spend some time learning how to better navigate the site.
<signature>
It's good to live,
Josef Wainz
Software Developer
|
|
|
|
|
Using the search system is very difficult IMO. I go directly to a category which I believe matches what I want to find, and do CTRL+F on that page, or I google for it. Most of the times I end up here at CP using google.
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
Hi,
I am automating Word 2000 and I want to disable the "Ctrl C" keyboard functionality. (Using VBA I am successful in disabling the "Ctrl+C" by doing this - "Application.FindKey(BuildKeyCode(wdKeyControl, wdKeyC)).Disable")
I am using the following C++ automation code which gives me the DISP_E_EXCEPTION error code on IDispatch::Invoke for "Disable" method ("AutoWrap" function below is a wrapper around IDispatch::Invoke). Here is my C++ code:
parm1.vt = VT_I4;
parm1.lVal = wdKeyControl;
parm2.vt = VT_I4;
parm2.lVal = wdKeyC;
VariantClear(&result);
AutoWrap(DISPATCH_METHOD, &result, pWdApp, L"BuildKeyCode",2,parm2,parm1);
parm1.vt = VT_I4;
parm1.lVal = result.lVal;
VariantClear(&result);
AutoWrap(DISPATCH_PROPERTYGET , &result, pWdApp, L"FindKey", 1,parm1);
pWdKey = result.pdispVal;
AutoWrap(DISPATCH_METHOD, NULL,pWdKey , L"Disable", 0);
Error :
"This method or property is not available because this document is in another application"
I will appreciate any help on this.
Thanks.
Vishal More
|
|
|
|
|
Hello,
I just want to show up an RTF report file previously created using automation into a non-modal dialog.
CRichText activeX control does not work for this purpose as shows tables, headers etc... diferent from what is into RTF file.
I've read about Active Document and the ability to use MS Word seamessly into my aplication.
I've downloaded a couple of examples and read a bit about (hard to implement technology, my aplication doesn´t support (i.e. didn't check active container support in wizard when created).
It looks that MS Word (or any other active document) takes control of the aplication (menus, look & feel, etc..)
I would like to avoid using active document technology as looks hard to implement from scrach. But if necessary, and before start learning it. I would like to know if active document will allow me to hide *ALL* menu, rules and hassle around the document itself and will let me put it into a dialog with a just print button.
I would really appreciate any comment, help.
Regards,
Carlos.
|
|
|
|
|