|
Hi,
I wasn't able to replace LPSTR with BSTR. My knowledge about C++ is limited and I did not find corresponding conversion.
Anyway, I added string attribute and started using CoTaskMemAlloc on C++ side and so far it's working under Vista too, so thank you very much!
zilo
|
|
|
|
|
I am trying to send an array from my C# app to an ActiveX component. The array consists of floats and I have used the following declaration:
DISP_FUNCTION(MyCtrl, "SetArrayFunc", SetArrayFunc, VT_EMPTY, VTS_PR4 VTS_I2)
where SetArrayFunc looks like this:
void MyCtrl::SetArrayFunc(float *NewBuffer, short Length)
In my C# app i try the following:
ThisCtrl.SetArrayFunc(ref MyBuffer[0], (short) MyBuffer.Length);
Where of course MyBuffer is an array of floats.
However it seems as though only the first element of the array is transferred.
I have also tried using VTS_VARIANT but that did not work either.
Is there anyone here who has an idea how to solve this?
|
|
|
|
|
I would change SetArrayFunc to take an OLE SAFEARRAY. Then you should be able to pass the array directly.
Nathan
|
|
|
|
|
I'm not sure how to do that, simply replacing VTS_PR4 with SAFEARRAY gives me the following error:
"error C2275: 'SAFEARRAY' : illegal use of this type as an expression", so I guess that was not how you meant?
|
|
|
|
|
Hampus@foi wrote: I'm not sure how to do that, simply replacing VTS_PR4 with SAFEARRAY gives me the following error:
"error C2275: 'SAFEARRAY' : illegal use of this type as an expression", so I guess that was not how you meant?
SAFEARRAYs are fairly complicated. You'll need to read a bit of documentation on how to use them. If you don't have the info on your own computer, I think you can look it up on msdn.microsoft.com.
Nathan
|
|
|
|
|
Create safe array of variants where variant elements will contain the floats. Let me know if this helps.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi Everybody,
I have been trying to save a powerpoint slide from a win32 sdk application.
My Requirment is like this, From my application i need to open a powerpoint application using ole and then save the slides as bitmap .But this is not possible for me to use any mfc based application or active x control.
Can anybody please help me out in this case
Thanks in advance
Niloy
|
|
|
|
|
Hi,
I want to create a phone number control. It has text boxes for a USPhone number, an international phone number and international country code. I want it to display the USPhone field and d so in a formatted manner. If the record's Country is blank or "US" or "Canada"...
I think I can create the control. Will I be able to import it into Access and use it on a form that is bound to a table, such that I can bind this control to several fields in the table?
Thanks!
Chuck
|
|
|
|
|
Hi,
I am trying to use the Visual SourceSafe 2005 SSAPI.DLL in a simple Windows application (C++), but I can't get around an error that indicates that the classes of the DLL are not registered. I have manually registered the DLL using the REGSVR32 utility, but I still get the error.
Any help greatly appreciated.
|
|
|
|
|
Is Visual Source safe registered on your machine? If this is the case then, it is possible the construction of CoClass fails resulting CoCreateInstance returning Class not registered error.
See - http://support.microsoft.com/kb/201431
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I'm missing the OLE Container control from VB6 so ny question is
Is it possible to build a Com component which acts as an OLE container control for one specific COM EXE server?
It should provide a window for InPlaceActivation of the specific server, for example Microsoft Equation Editor.
Thankx in advance
Lennart
LLINF
|
|
|
|
|
Once I click the receive button twice, accidentally, the NULL modem program running between two PCs is hung !!
How can I detect the data is received so that I can read the data without hanging the COM program written in C# Visual Studio .Net.
Any one can help.
Thank you
yak
|
|
|
|
|
I have a COM collection object that maintains two STL containers. While it is unlikely, it is possible that an exception will be thrown while the containers are out of sync. In a normal application, I would simply abort under those conditions. What should an in process COM server do if such a fatal error occurs?
Nathan
|
|
|
|
|
Nathan,
Usually, Exceptions in COM server shouldn't bubble up. Since it's an inproc server, aborting would terminate your client application. I don't know any solution that I have implemented but does any of the following help you device a framework -
1. Supporting ISupportErrorInfo for rich error information and your methods could fail with some HRESULT. Client is expected to take necessary action.
2. Not a good one, but if these are internal error and assuming there is no method call in progress, you could implement an event handler and notify client of this exception.
Just back from work so can't think of any more solutions
Let me know if this helps.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Thanks! That's about what I thought. From what I've read, E_UNEXPECTED is intended for that sort of thing.
Nathan
|
|
|
|
|
Yes. by HRESULT I meant E_UNEXPECTED in this case, but you may want to specialize this error code if required.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hello all
I'm trying to use activeX to write a web interface for my application.
Does anyone know where to start to learn how to write activeX controls using C/C++ without ATL or MFC but accessing it from scratch.
Or can anyone recommend any good books?
thx
Bmbsage
|
|
|
|
|
Ask to Jeff Glatt [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I just want to make a software that needs some calculations and waveform plot in matlab 7...
I have written the required .m files and using the combuilder of matlab 7 to generate the com files to be used in VB .Net. but after compilation in VB .Net the generated stand alone exe file still needs the MATLAB RUNTIME LIBRARY. Is there any possible way to make it independent of The MATLAB And its Run time library....
if I compile the .m file to generate .exe file using matlab... then also the dependency remains...
plz tell me how this can be solved.....
Thank You.......
@rish
|
|
|
|
|
You cant because the way COM operates. The matlab Client (COM VB Object) will allways referenciate to a Matlab Server. Maybe you can connect to a Matlab Server in another Machine but you will always depend on the runtime libraries because the server needs them.
JO
|
|
|
|
|
Hey everyone!
I'm not sure if this is the right place, but I'm having some issues trying to debug a managed application invoking a COM server.
When I attach the native debugger, the modules window of visual studio tells me that there are no symbols loaded for my interop assembly (Interop.xxx.dll). It fails to load xxx.pdb, which I can understand. However, I have no idea how I have to generate the symbols. I've tried looking in the usage of tlbimp, but no such luck.
Any pointers on this?
|
|
|
|
|
|
Hey Sohail, thanks for the quick reply. However, I think this is not what I need, as the dll I'm using is one of my own, and not one provided by Windows. I have the debugging symbols of the original dll, but they won't work with the interop dll I've generated with tlbimp (it complains when I try to load it in the modules view). Do I have to use the original pdb or is there a way to generate one from the interop dll?
|
|
|
|
|
|
Hello Friends,
The issue is given below:
I want to connect skype with outlook following way.
There will be an Outlook Addin(Dialog) with a button named "PHONE".The dialog contains information of the specified user(sender of the selected message in inbox)including Phone number.
How can I setup a call when clicking the "PHONE" button. And i should able to talk with him.
so thing is i need not to enter the phone number through my phone button.
if anyone having some idea over this then plz send it to me i will appreciate it.
very urgent .....
please help me.....
regards,
Sivan Manimala
|
|
|
|