|
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
|
|
|
|
|
You need to actually create the control. You created an instance of COPOSCashDrawer, but you never actually created the component. Call um.CreateControl();
|
|
|
|
|
WindowA->DoModal(popup DialogB)
<br />
DialogB<br />
|<br />
|----------ControlA<br />
............|<br />
............-------------ControlAA<br />
i wanna handle ControlAA's message in DialogB and don't wanna write a custom class for ControlA, is it possible? i think i could achieve this by changing the default dialog procudure? how to change the dialog procedure?
-- modified at 0:23 Friday 14th October, 2005
|
|
|
|
|
does the message first reach the DialogB then the ControlA last arrive ControlAA?if it's true ,could i handle it in DialogB? how?
|
|
|
|
|
hi all,
i just wrote a com, but now have a problem that is my com can not share the data between applications.
Any help would be greately appreciated
|
|
|
|
|
kiluar wrote:
i just wrote a com, but now have a problem that is my com can not share the data between applications.
this link will help :-
http://www.codeproject.com/dll/data_seg_share.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
can you write a function
putdata() and getdata()
to share data between applications
ddddddddddddddddddddd
|
|
|
|
|
wlwlxj wrote: can you write a function
putdata() and getdata()
I can't understand ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
There is this article on CP A Technique to Customize the Title Bar of Windows
[^] which lets you draw the title bar of an application. I have to do the same thing but all my applications are written in MFC. So my question how could I use the above mentioned code in MFC? Or is it possible? If not how could I custom draw the title bar in MFC. Or how could I combine the two?
Any sugestions would be greatly apreciated. This is a time sensitive matter.
regards,
Mircea Grelus
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
I forgot to mention. I'm refering to VC6.
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
Is there some one who can help me to design a COM component ?
thx
----------------------------
Jerry yu
Chinese
programming fans
|
|
|
|
|
Let me know the details. I'll try help you.
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I can ,but how i help you.
I'm chinese, email me(wlwlxj@163.com) when you have troubles.
ddddddddddddddddddddd
|
|
|
|
|
THX
----------------------------
Jerry yu
Chinese
programming fans
|
|
|
|
|
use W2T
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
W2A
ddddddddddddddddddddd
|
|
|
|
|
I have a class written in WTL 7.0 but I want to use it in my MFC application.How can i do that. The class use WTL CString but I think it isn't recognized in MFC
I tried to add the class into my project but I got the following code when I conpiled:
fatal error C1010: unexpected end of file while looking for precompiled header directive
Can you help me?
Thanks a lot!
|
|
|
|
|
That depends on what WTL features it uses. WTL::CString is a clone of MFC::CString so that won't be a problem to drop it into an MFC project. If it uses windowing classes, it will depend on whether it's a stand-alone control (like say CHyperLink ).
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
hi all,
i want to pass a struct parameter ,but i don't known what data type i should use for my custom struct,thank you!
Any help would be greatly appreciated!
|
|
|
|
|
I think SAFEARRAY can be used here.
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
hi Sohail Kadiwala,
thanks for your help,the problem has been solve d, i'm thank you very very much!
|
|
|
|
|
you can convert pointer to long ,and convert to former pointer after passed
ddddddddddddddddddddd
|
|
|
|
|
A new Java-like framework has just been released by SwingC.com.
SwingC is a great UI framework that can be used in place of MFC, or any other GUI framework. It has a java-like syntax, and works flawlessly.
|
|
|
|
|
|
Al Baraki wrote: A new Java-like framework has just been released by SwingC.com.
HeartFriend wrote: where can i get it?
|
|
|
|