|
Hello,
I have COM component. It contains one GetRecordSet method which takes one of the parameter ADODB.Connection and return ADODB.Recordset. But while accessing through ASP it gives error Invalid Procedure call or argument.
Same method works fine from VB and VC.
If you have any solution for it,then plz let me know.
Thanks !
Regards,
Vibhuti
|
|
|
|
|
I have a C# class which contains a jagged array as one of its properties exposed to COM:
string[][] Measurements
The property vcan easily be read/set by .Net applications but I was asked to expose it to COM applications (namely VB6 and VBScript). I was able to expose all the properties to COM except this jagged array because there's no marshalling support for jagged arrays. So, I've tried to change it from string[][] to string[,] Measurements, but now I can see this property in VB6 and when I call it I can't get the data populated in a VB array. LBound and UBound give the correct array size but this code give wrong type error:
For r = LBound(objClass.Measurements, 1) To UBound(objClass.Measurements, 1)
For f = LBound(objClass.Measurements, 2) To UBound(objClass.Measurements, 2)
sMeasurements = sMeasurements & objClass.Measurements[r, f])
Next
Next
And this code returns the data scrambled: the values in objClass.Measurements(0,0) then objCard.Measurements(1,0) then (0,1) then (1,1) etc. instead of (0,0) then (0,1) then (0,2) then (0,3) etc.:
For Each sReading In objClass.Measurements
Debug.Print sReading
Next
Any idea how I should declare the jagged array in the C# module and how I should call it from VB6 or VBScript?
Thanks,
Martha
|
|
|
|
|
AFAIK, this example demonstrates jagged array in VB:
Dim v As Variant, i As Long, j As Long
v = Array(Array(1, 2), Array(3, 4, 5))
For i = LBound(v) To UBound(v)
For j = LBound(v(i)) To UBound(v(i))
Debug.Print v(i)(j)
Next
Next
It can be also applied to "v() As Variant".
With best wishes,
Vita
modified on Wednesday, March 25, 2009 5:30 AM
|
|
|
|
|
Hi Guys. My first post in this forumn so please bare with me. I have built an app that references office 12 because I have Office 2007 installed on my PC. However, when I build the exe and install this on another machine it doesn want to work. Is it because the other machine has office 2003 installed on it? Is there an easy way for me to get around this other than having to uninstall Office 2007 from my machine and installing Office 2003 so I can reference the correct com file and build the project with it??
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
The simplest and most obvious solution is to write a function that determines what version of Office is installed on the LOCAL MACHINE, and then references the existing library component based on that condition.
|
|
|
|
|
Thanks for the reply Baltoro but I have no idea how to do this. Do you know of any posts that shows how to do this? I'm just on Google and can't find anything or I might be searching for the wrong thing.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
All COM classes have registry entries (this is what the COM Library uses to activate objects). Searching the registry is pretty simple. As I recall, Microsoft applications have thousands of registry keys and values. I would guess enumerating, HKEY_LOCAL_MACHINE\SOFTWARE subkeys for Microsoft subkey, and then specific subkeys for Office 12, and eventually, you're looking for a Current Version subkey and value.
Also, you might try searching here: Object Library Reference for Microsoft Office 12[^]
|
|
|
|
|
Hi
I am implementing security on Contact base smart card which follows scosta template.In card structure ef is directly under DF and DF is directly under MF. According to the template i am implementing security on elementary file(both sac and sae attributes are specified at time of creation in fcp) according to security condition read and update of record requires verification of pin(which is already defined in pin file).
Problem is that after implementing the security attributes on card now also my card is not following that,after selecting the file i can directly read and write on record, card does not ask for verification of pin.
please help me asap...............
|
|
|
|
|
hi how did u created MF, DF and EF files in smartcard please let me know.
|
|
|
|
|
how i can display an icon(bitmap,png,...) on a button in an activex control. i have used LoadImage function and obtained the button without an icon as a result. When i used this function in a dialog based MFC application it worked. what is the difference of activex control ?
here what i used;
HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON3), IMAGE_ICON, 16, 16, 0);
mb_PickUp.SetIcon(hIcon);
thanks in advance
|
|
|
|
|
Is GetModuleHandle(NULL) now getting a different resource handle than before?
|
|
|
|
|
actually in a dialog based application everything is fine for GetModuleHandle(NULL) funtion but in activex it returns NULL so it seems that is the problem. any suggestion to fix this.
thanks
|
|
|
|
|
|
i use the activex in the browser so what should be the path of dll/exe that my activex lives in. iexplorer.exe ?
|
|
|
|
|
What is your activeX written using, MFC? ATL? Win32? Whatever it is, though you could find the name/path to pass there may be a function called something like GetResourceInstance() you can call which will do it for you, have a look.
|
|
|
|
|
it worked thanks very much.
|
|
|
|
|
Hello, is it possible to create a COM objects structure as below:
In a dll library I define:
class T1
{
public:
STDMETHOD(Method)();
}
STDMETHODIMP T1::Method()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
return S_OK;
}
which implements interface:
interface IT1 : IDispatch
{
[id(1)] HRESULT Method();
};
coclass T1
{
[default] interface IT1;
};
and then I would like to have:
class T2 : public T1
{
}
I would like to create a COM objects from the class T2 and have all the functionality provided by class T1. E.g. I would like to call:
CComQIPtr<it2> spiT1(piT2);
spiT1->Method();
</it2>
Anyone can help?
|
|
|
|
|
have you had a try?
if it didn't work, maybe you could define a new interface:
interface IT2:IT1
|
|
|
|
|
Although this would work, T2 would be an ordinary class while T1 is a com class.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I think you want to use aggregation.
"To expose the interfaces of one COM class as though they were implemented on a second COM class, the second class aggregates the first. "
|
|
|
|
|
Hi All,
I have one COM+ EXE and i want to import it in my client application and want to use its function.So please can anyone help me.
Thanks A Ton
Ash_VCPP
modified on Wednesday, March 18, 2009 7:15 AM
|
|
|
|
|
If you use the dumpbin utility to tell you which functions are exported by your COM+ EXE, you will find that it should export a number of standard COM server routines, which you can call from your client application. You don't really import the COM+ EXE, the COM library will load it when you make an In-Process activation request (for instance, CoGetClassObject).
Your COM+ EXE should export RegisterServer, which adds a number of entries to the registry on your computer (look in, HKEY_CLASSES_ROOT\CLSID).
This Larry Osterman blog: Registry Entries Needed to Create a COM Object[^], might be helpful.
|
|
|
|
|
can you please provide me some code or procedure to call com+ methods??
Thanks A Ton
Ash_VCPP
|
|
|
|
|
im a com beginner, i know its more complex than normal usage. Here i list some classes as following:
class A{
//...some member variables, such as c strings, and other class variables
};
class B{
//...some member variables, such as c strings, and other class variables
};
class C{
//...some member variables, such as c strings, and other class variables
A* m_pAobjects;
B* m_pBobjects;
};
In the project, there would be only one instance of class C, but there would be more than one B instances and A instance; And i can create one C instance, which will read some data from some files or generate some data on the fly; and i can get the count of its internal A or B instances, retrieve specified objects from the instances.
But, i don't know how to design the project to com architecture. My main problem is,how to design and implement the interfaces? and how to transfer the parameters between the com client and the server?
thanks
|
|
|
|
|
As a start: Find something on Unified Modelling Language (UML) related to COM, though be careful as some UML descriptions can get a bit complicated. Basically get some paper, draw your COM objects as boxes and any interface such as IUnknown or IMySettings as, well, 'lollipop' or spoon shapes on those boxes. Find a few examples and you'l see what I mean.
Then try a sequence diagram to show the messages (calls) between the COM objects. Once you're satisfied you have the messages sorted you need to design interfaces to provide methods which convey those messages.
|
|
|
|