|
yep ! I got that from MSDN
Thanks for the help !
solved my problem
cheers
Sagar
Love Is photogenic,It require a dark to develope
|
|
|
|
|
Hi there!
I have a dll that has only one ATL object.
Now, I need to add a second one, and I would like to add to the same dll (this way I don't need to register a new dll, just the old one with the new object!).
I add it using the VC6 wizard, it compiles ok, but when I try to use it via VB, it gives the error "Can't create activex object!".
It's not a problem in the code, since if I put it in a stand alone dll it runs ok.
Does any one knows what kind of magic I need to do to make it run?
ALMC
|
|
|
|
|
almc wrote: I have a dll that has only one ATL object.
Now, I need to add a second one, and I would like to add to the same dll (this way I don't need to register a new dll, just the old one with the new object!).
are you adding the ATL Object or Method/property... If you are adding ATL object you have to register the dll again ....
"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
|
|
|
|
|
hi all,
iam creating dialogbar activex control ..thru ATL..
i created one dialogbar resource...
when i insert that control in test container..its not visible.
if i want to see in test container,whats the procedure...can u please guid me through small code snippet?
best regards,
tirucapricorn
|
|
|
|
|
I'll show some code about card,write by myself,i'm chinese:
void CCardsCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
// TODO: Replace the following code with your own drawing code.
CBitmap* pOldBitmap = NULL;
CBitmap bitmap;
CDC bmpDC;
CRect rect;
CPoint ptLeftUp;
//ÔËÐÐģʽÏÂÒƶ¯´°¿Ú
if(AmbientUserMode())
{
GetRectInContainer(&rect);
rect.bottom -= m_sOffset;
rect.top -= m_sOffset;
MoveWindow(rect);
}
//»æÖÆÆË¿Ë
bmpDC.CreateCompatibleDC(pdc);
if(m_bBackground) //ÏÔʾ±³¾°
{
if(m_sBackBmp == 1)
{
bitmap.LoadBitmap(IDB_BITMAP_BACK1);
}
else
{
bitmap.LoadBitmap(IDB_BITMAP_BACK2);
}
}
else //ÏÔʾÅÆÃæ
{
bitmap.LoadBitmap(IDB_BITMAP_11+m_sValue-1);
}
pOldBitmap = bmpDC.SelectObject(&bitmap);
pdc->BitBlt(rcBounds.left, rcBounds.top, rcBounds.Width(), rcBounds.Height(), &bmpDC, rcBounds.left, rcBounds.top, SRCCOPY);
bmpDC.SelectObject(pOldBitmap);
bitmap.DeleteObject();
}
ddddddddddddddddddddd
|
|
|
|
|
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.
|
|
|
|