|
AX controls have to be marked "safe" before you can use them in IE. Look up IObjectSafetyImpl in MSDN.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
You cannot truly appreciate Dilbert unless you've read it in the original Klingon.
|
|
|
|
|
Hi Friends,
I am store some data into vector and mapping it long key for searching (1::1 mapping).Below code
---------------------.h file------------------------
typedef std::vector<item *=""> m_cache;
typedef std::map<long, item="" *=""> m_index;
typedef std::pair<long, item*=""> INDEX_ENTRY;
INDEX_ENTRY IndexEntry(Item * plu);
--------------------.cpp-------------------------
m_cache.push_back(item);
m_index.insert(IndexEntry(item));
-------------------------------------------------
Now the requirment is to retrive the same data with any of 2 different key long1 and long2 from the same vector(1::2 mapping). Can you please help me how to do this?
Thanks
|
|
|
|
|
please correct your message: < and > characters should be writen as < and >
and then u can get some help..
|
|
|
|
|
Hello!
I have a problem when define struct in atl 7.0. I develop it in vc.net. That's part of code below:
My com component has a face ISimpleFace:
//FILE SimpleFace.h
//my costum struct
struct tPosition
{
double x;
double y;
};
// ISimpleFace
[
object,
uuid("1C499BAD-9BAE-47AF-966F-EB972FA8DF47"),
dual, helpstring("ISimpleFace 接口"),
pointer_default(unique)
]
__interface ISimpleFace : IDispatch
{
[id(1), helpstring("方法TestStruct")] HRESULT TestStruct([in] struct tPosition pos);
};
When I complie it, out some errors:
e:\work\mysimpleface3\simpleface.h(23) : error MIDL2011 : unresolved type declaration : tPosition [ Parameter 'pos' of Procedure 'TestStruct' ( Interface 'ISimpleFace' ) ]
e:\work\mysimpleface3\simpleface.h(23) : error MIDL2009 : undefined symbol : [ Parameter 'pos' of Procedure 'TestStruct' ( Interface 'ISimpleFace' ) ]
What's the problem,how to define a struct in vc.net? Is there somebody can help me? Thanks!
|
|
|
|
|
I believe that you need to define your struct in .idl file. See what MSDN has on this issue.
|
|
|
|
|
Thanks for your reply!
But I do it with COM Attribute Program. The complier genrates idl file for me automately. How to define a struct in Attribute Program.
|
|
|
|
|
Edit the idl file manually and define your struct there. Check MSDN, it should have a lot of info.
|
|
|
|
|
I haven't used Attributed programming in ATL. Try adding the UUID attribute to your structure -
[
uuid("your uuid"),
helpstring("custom struct")
]
struct tPosition
{
double x;
double y;
};
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Thanks for your reply!
But add a UUID attribute is not help.
|
|
|
|
|
As I mentioned I never worked with Attributed programming. I'll watch this question for appropriate answer. Incase you find answer to your problem, please share here. Thanks.
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
To Sohail Kadiwala:
Thanks! Of couse I will.
|
|
|
|
|
Hi All,
I have created one system wide hook in one of my dll file say myHook.dll like this:
hGetMsgHook = SetWindowsHookEx( WH_GETMESSAGE, GetMsgProc,
(HINSTANCE)hmodHook, 0 );
Now the confusion is that, while anyprocess sends any message, This function will be called from within the address space of that process itself or outside that proecess. Which process address space this function will map to?
Just like in setWinEventHook API we have one flag for setting this WINEVENT_INCONTEXT or WINEVENT_OUTOFCONTEXT, dont we have anything to control the same for SetEindowsHookEx API?
Thanks in advance for all your suggestions...
Regards
Abhinav
HCL Technologies, Noida(India)
|
|
|
|
|
Abhinav agrawal India wrote: while anyprocess sends any message, This function will be called from within the address space of that process itself or outside that proecess. Which process address space this function will map to?
WH_GETMESSAGE can be created as a global or a thread specific hook.
If you created it as a global hook it is mapped (AFAIK) to all of the processes in the system (well, the current desktop). Specific calls to your hook come from the address space of the process that called GetMessage or PeekMessage.
RemoteLib uses global hook to inject any dll to the target process:
-it installs a global hook
-it then forces the hook to be balled by sending a message to the target window
-when the hook is called, the hook procedure calls LoadLibrary from the target process space and thus loads the dll too the target process space.
Also see http://codeproject.com/dll/#Hooks
H.
|
|
|
|
|
in my dll i have couple of interfaces
from that i want to hide 2 from User
how this is done
plz help
Sagar
Love Is photogenic,It require a dark to develope
|
|
|
|
|
[hidden] attribute should help.
|
|
|
|
|
can U plz explaing bit more
Sagar
Love Is photogenic,It require a dark to develope
|
|
|
|
|
From MSDN:
hidden
Description
Indicates that the item exists, but should not be displayed in a user-oriented browser.
Allowed on
Property, method, coclass, dispinterface, interface, library.
Comments
This attribute allows members to be removed from an interface by shielding them from further use, while maintaining compatibility with existing code.
When specified for a library, the attribute prevents the entire library from being displayed. It is intended for use by controls. Hosts need to create a new type library that wraps the control with extended properties.
Flags
VARFLAG_FHIDDEN
FUNCFLAG_FHIDDEN
TYPEFLAG_FHIDDEN
|
|
|
|
|
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
|
|
|
|