Print Page | Close Window

Using the OCX file in C++

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=22128
Printed Date: 02 May 2024 at 11:27am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Using the OCX file in C++
Posted By: aaron1a12
Subject: Using the OCX file in C++
Date Posted: 13 December 2013 at 12:21am
Hi guys,

I'm developing my application with Win32 API and wxWidgets in C++, and I wanted to skin the app so I decided to try out the ActiveX OCX version of Skin Framework from Codejocks. The problem is that all the samples are in C#, Vb, and VB.NET but NOT in C++! I assume because most C++ users will be going for MFC version but I'm not.

Having very minimal knowledge in ATL, I have NO idea how to load the OCX in C++. 

Could someone tell me what's wrong in my code?

#include <atlbase.h>
#import "SkinFramework.ocx"

...

CoInitialize(NULL);

_DSkinFrameworkPtr MySkinframework;
HRESULT instanceResult = MySkinframework.CreateInstance("{bdc91302-2481-46d0-a36c-164e03514d79}");

    _com_error instanceErr(instanceResult);
    LPCWSTR instanceErrMsg = instanceErr.ErrorMessage();
    MessageBox(NULL, instanceErrMsg, L"CreateInstance Result", MB_OK);

MySkinframework->AboutBox();



CreateInstance throws a "The operation completed successfully" message but ->AboutBox(); results in this:
Unhandled exception at 0x773276fd in TestApp.exe: Microsoft C++ exception: _com_error at memory location 0x001afb30..

Is this the proper way to interact with an OCX? Is it the proper way to use Skin Framework? Am I using the right class id? Please help Cry



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net