Click here to Skip to main content
15,922,427 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Hiding Interface in ATL Pin
logicaldna19-Oct-05 23:13
logicaldna19-Oct-05 23:13 
GeneralRe: Hiding Interface in ATL Pin
Igor Vigdorchik20-Oct-05 3:22
Igor Vigdorchik20-Oct-05 3:22 
GeneralRe: Hiding Interface in ATL Pin
logicaldna20-Oct-05 17:35
logicaldna20-Oct-05 17:35 
QuestionAdding a second object to a ATL/COM dll Pin
almc18-Oct-05 6:15
almc18-Oct-05 6:15 
AnswerRe: Adding a second object to a ATL/COM dll Pin
ThatsAlok4-Dec-05 22:21
ThatsAlok4-Dec-05 22:21 
Questiondialogbar control Pin
tirucapricorn14-Oct-05 19:56
tirucapricorn14-Oct-05 19:56 
AnswerRe: dialogbar control Pin
wlwlxj14-Oct-05 20:57
wlwlxj14-Oct-05 20:57 
QuestionIDispatch - I NEED HELP! Pin
honae14-Oct-05 7:58
honae14-Oct-05 7:58 
Hi,



I have a registred ocx that implements the fallow method

CString COPOSCashDrawer::GetDeviceDescription()
{
CString result;
InvokeHelper(0x1d, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}

I created a dll that implements the fallow method:

STDMETHODIMP CCashDrawer::get_DeviceDescription(BSTR *pVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())

CComBSTR bstStr( this->DeviceDescription );

*pVal=bstStr.Detach();

// TODO: Add your implementation code here

return S_OK;
}

This method belongs interface ICashDrawer : IDispatch

I want to do a application that make the ocx's method
CString COPOSCashDrawer::GetDeviceDescription() make call to the dll's method
STDMETHODIMP CCashDrawer::get_DeviceDescription(BSTR *pVal)

I tryed to import the Controll into a project(Project->Add to
Project->Componentes and Controls->Registred ActiveX Controls), then I tryed
to create a instance of a ocx's class and make call to the method
GetDeviceDescription(). The fallow error menssage was draw me:

DEBUG ASSERTION ERROR!
File: Winocc.cpp
Line: 345

Please, can you help me?

the fallow code is the application...(example)
// teste.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "teste.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// The one and only application object
#include"oposcashdrawer.h"//CLASS OF CONTROL

CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
COPOSCashDrawer um;//INSTANCE OF CONTROL

// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}
else
{
// TODO: code your application's behavior here.
/*CString strHello;
strHello.LoadString(IDS_HELLO);
cout << (LPCTSTR)strHello << endl;*/

um.GetDeviceDescription();//CALLING THE METHOD( THIS CAUSES THE ERROR...DEBUG ASSERTION ERROR! FILE: WINOCC.CPP LINE: 345;




}

return nRetCode;
}



Grateful!

--
Honae
AnswerRe: IDispatch - I NEED HELP! Pin
JonEngle14-Oct-05 8:26
JonEngle14-Oct-05 8:26 
Questionhow to handle message of grandchild window Pin
HeartFriend13-Oct-05 18:23
HeartFriend13-Oct-05 18:23 
AnswerRe: how to handle message of grandchild window Pin
HeartFriend13-Oct-05 19:44
HeartFriend13-Oct-05 19:44 
Questionhow to implement for sharing data in com Pin
kiluar13-Oct-05 0:14
kiluar13-Oct-05 0:14 
AnswerRe: how to implement for sharing data in com Pin
ThatsAlok13-Oct-05 20:18
ThatsAlok13-Oct-05 20:18 
GeneralRe: how to implement for sharing data in com Pin
wlwlxj14-Oct-05 21:04
wlwlxj14-Oct-05 21:04 
GeneralRe: how to implement for sharing data in com Pin
ThatsAlok14-Oct-05 23:53
ThatsAlok14-Oct-05 23:53 
QuestionWTL User Interface in MFC application Pin
Mircea Grelus12-Oct-05 22:11
Mircea Grelus12-Oct-05 22:11 
AnswerRe: WTL User Interface in MFC application Pin
Mircea Grelus12-Oct-05 22:17
Mircea Grelus12-Oct-05 22:17 
QuestionI need a high man to help me Pin
Fired Fish12-Oct-05 19:02
Fired Fish12-Oct-05 19:02 
AnswerRe: I need a high man to help me Pin
User 21559713-Oct-05 7:50
User 21559713-Oct-05 7:50 
GeneralRe: I need a high man to help me Pin
wlwlxj14-Oct-05 21:05
wlwlxj14-Oct-05 21:05 
Questionhow to change BSTR variability to STRING Pin
Fired Fish12-Oct-05 18:20
Fired Fish12-Oct-05 18:20 
AnswerRe: how to change BSTR variability to STRING Pin
ThatsAlok13-Oct-05 20:16
ThatsAlok13-Oct-05 20:16 
GeneralRe: how to change BSTR variability to STRING Pin
wlwlxj14-Oct-05 20:50
wlwlxj14-Oct-05 20:50 
QuestionHow to use a class written in WTL 7.0 in an MFC application Pin
cauvang12-Oct-05 15:14
cauvang12-Oct-05 15:14 
AnswerRe: How to use a class written in WTL 7.0 in an MFC application Pin
Michael Dunn21-Oct-05 9:59
sitebuilderMichael Dunn21-Oct-05 9:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.