Been programming for too long, but always wanted to understand how to call a COM object from within a win32 c application. So I'm starting here hoping for some guidance. Although I have VS 2008, I would like to do this in Codeblocks. The COM object I want to use is for Sage 100. I currently load the COM object using Lazarus (DELPHI) like so: unit header_boi.pas const boi_so_err = 1; boi_data_path = '\\MM-2012-MAS-DEV\Sage\Sage 100 Advanced ERP\MAS90'; boi_script = 'ProvideX.Script'; boi_session = 'ProvideX.PvxDispatch'; unit boi_api.pas hboi_script := CreateOleObject(boi_script); In C, it is my understanding, I need to use CoCreateInstance?? Is this correct? Problem is, I just don't know. I have lots of books, but would love some guidance. Best in 2021, Good karma promised. Bret
Bret Stern
Posts
-
Win32 - Use COM object help -
.net memory leaksThank you. Seem to remember something about garbage collection being automatic. The environment looks pretty slick. Should be lots of fun.
-
.net memory leaksNot use to the memory babysitting. Thanks for the explanations.
-
.net memory leakstop right of form. Looks like memory is leaking. Don't rememebr vb6 doing this. Many thanks. -
Structure passing problemI thought I checked that. It fixed the problem. Thanks for the help. I sense a series of adjustments going from VB6 to VS 2008 is ahead.
-
Structure passing problemByRef cured the problem. I was going down fast. thanks In the actual program it is a function. I slimmed down the code for my question. Thanks for the comment though, and help.
-
Structure passing problemI'm moving from VB6 to VS 2008. And need help with a data structure problem. In a Public code module in my VS 2008 project, I defined a structure: Public structure db_connection dim connection_string as string End structure Then defined a variable as the structure type: Public db_con as db_connection When I pass the db_con variable to a sub: sub db_create_cs(dbc as db_connection) dbc.connection_string = "some values" end sub I expected the db_con.connection_string value to equal "some values" after the call. Regards.