Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » OLE Automation (Request more help with OLE Automation)
Re: OLE Automation [message #51286 is a reply to message #51280] Sat, 02 March 2019 13:01 Go to previous messageGo to previous message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Dear Xemuth,

It is indeed amazing, the way you have advised, step-by-step, with code. I'm at loss of words to thank you. I'm very novice in this kind of coding, hence I have tried to use your code as it is, with some previous trials I have made. Here are some further questions I have in this regard:

1. In function AutoWrap (it's very high level code for me), for the line
WideCharToMultiByte(CP_ACP, 0, ptName, -1, szName, 256, NULL, NULL);

MS compilers gives the following 2 errors:

    E:\UPP_Projects\Testing\main.cpp (33): error C2065: 'CP_ACP': undeclared identifier
    E:\UPP_Projects\Testing\main.cpp (33): error C3861: 'WideCharToMultiByte': identifier not found
while MINGW doesn't complain.

2. Is it OK to get the CLSID like this? It seems to be working:
CLSIDFromProgID(L"StaadPro.OpenSTAAD", &clsid);


3. The requirement of the current assignment is to read some data from a running instance of STAAD, hence rather than CoCreateInstance, is it OK to use GetActiveObject, as follows? It also seems to be working:
HRESULT hr = GetActiveObject(clsid, NULL, (IUnknown**)&pUnk);


4. Thanks to your advice, I have figured out how to access properties and methods of the App. I can now read properties returning integer or double from the App. How about string properties? And how about using properties which perhaps return arrays of int or double (the getbeamlength in fact returns an array of double).

I'll study more in the examples of github as you suggested. Your advices are indeed of great help, truly appreciate it.

Have a nice weekend.

Thanks and regards,
Pradip


Regards,
Pradip
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: U++ with Visual Studio 2017?
Next Topic: [solved] Is it an encoding problem ?
Goto Forum:
  


Current Time: Sun Apr 28 21:14:57 CEST 2024

Total time taken to generate the page: 0.03043 seconds