|
I change the system to windows 2003, the problem was resolved.
|
|
|
|
|
Sounds like you're missing gdiplus.dll. That didn't come with Win 2K.
|
|
|
|
|
We have two EXE. one COM EXE.
when calling some methods written in COM EXE, shows the following message.
What is the exact problem?
" This action cannot be completed because the other program is busy.
Choose 'Switch To' to activate the busy program and correct the problem"
|
|
|
|
|
Many things can cause this...
1. Your COM server or Main thread died
2. Main thread is processing a long operation
God bless,
Ernest Laurentin
|
|
|
|
|
Hello,
I am naive to Windows Services.
I have few queries regarding Windows Services which are as follows: -
How to manage User account?
For example there are several users present on a single machine and how to restrict users group from accessing the Windows Service?
Can do it using CoInitializeSecutriy(), if yes then How?
Thanks in Advance.
|
|
|
|
|
tony_udz wrote: How to manage User account?
tony_udz wrote: Can do it using CoInitializeSecutriy()
The obvious answer is to use the Windows User Management tool. If you want to develop your own software to do that it is going to be far more complicated that using a couple of API calls. If you want to do Windows Security development I suggest you find a good book that covers that topic in depth.
led mike
|
|
|
|
|
Hey Led,
Yes i am looking for Windows Security Management.
Can you please tell me the name of that book?
Thanks!
|
|
|
|
|
Never read one myself. If I wanted to find one I would start here[^]
led mike
|
|
|
|
|
Hello Friends,
I have developed one ATL com dll for IE tool bar.
My Ie toolbar is having buttons which i have created dynamically.
buttons are having Icon images also.
but i am facing one problem...
I can show only the Icon with "Bit Depth=8" of .ico image.
Actually i want to show Icons with "Bit Depth=32" also.
I am using below code..
UINT colormap = LR_DEFAULTSIZE |LR_LOADMAP3DCOLORS| LR_LOADFROMFILE | LR_CREATEDIBSECTION|LR_LOADTRANSPARENT;
HBITMAP hBitmap =(HBITMAP) ::LoadImage ((HINSTANCE)::GetModuleHandle(NULL),ImagePath,IMAGE_BITMAP,0,0,colormap);
In above code...
while Debugging i came to know that i am getting null in hBitmap variable for Icons with "Bit Depth=32". for Bit Depth up to 24 it is working fine.
Please suggest me the solution....
modified on Monday, March 10, 2008 2:06 AM
|
|
|
|
|
Why are you using IMAGE_BITMAP if you're trying to load icons?
You should try IMAGE_ICON.
Hope it helps
rotter
The metaller programmer
|
|
|
|
|
Thanks for reply ...
Yes i am now using IMAGE_ICON.
it is workin fine...now I can add Icon with 32 bit Depth in my image list.
I observed one more thing that IMAGE_BITMAP works for icons also...but for icons with Bit Depth upto 24 only.
Thank you...
|
|
|
|
|
Hi Friends,
I am using VC++ 6.0 I careated an exe server using ATL. It has one interface mdethod "ComputerName". Prototype of method is :
[id(1), helpstring("ComputerName")] HRESULT ComputerName([out] short *pnSize, [out, size_is(1, *pnSize)] unsigned char **ppszComputerName);
Server implementation of this function is :
STDMETHODIMP CTestServer::ComputerName(short *pnSize, unsigned char **ppszComputerName)
{
TCHAR szBuffer[100] = {0};
DWORD dwSize = 0;
int iLength = 0;
dwSize = sizeof(szBuffer);
GetComputerName(szBuffer, &dwSize);
iLength = ::lstrlen(szBuffer);
*pnSize = iLength;
*ppszComputerName = (unsigned char *) CoTaskMemAlloc(iLength + 1);
::lstrcpy((char *) *ppszComputerName, szBuffer);
return(S_OK);
}
Client Side Implementation is :
ITestServer *pITestServer = NULL;
HRESULT hResult = NULL;
short int nSize = 0;
unsigned char *pszComputerName = NULL;
CoInitialize(NULL);
hResult = CoCreateInstance(....);
if(SUCCEEDED(hResult))
{
pITestServer->ComputerName(&nSize, &pszComputerName);
// Here is problem only pszComputerName[0] contains valid data. other contains invalid data. nSize contains valid length.
pITestServer->Release();
}
CoUninitialize();
I am unable to get the reason. Anyone can help me please.
Manish Rastogi
|
|
|
|
|
Hi Manish,
If you want to pass string, use BSTR. COM marshalling works a bit different.
If you plan to transfer 'byte*', use Safearray of byte.
God bless,
Ernest Laurentin
|
|
|
|
|
Thanks Ernest Laurentin
BSTR is working.
|
|
|
|
|
Hi All,
I have an ActiveX control. And the event map is defined in the control's implementation (.CPP) file.
Say the event map has a function
EVENT_CUSTOM("SomeEvent", FireSomeEvent, VTS_BOOL)
defined in it...
Now I can very easily call the function 'FireSomeEvent' from the control's implementation cpp file.
Can I call 'FireSomeEvent' from some other cpp file....means some other's class's code ??
If yes then how??
Urgent help needed...
Thanks and Regards
...A Programmer may or may not be the master of the programming language grammar...
|
|
|
|
|
//Main.h
__interface IFileIO : IDispatch
{
[id(1), helpstring("method GetFile")] HRESULT GetFile();
[id(2), helpstring("method getDirectory")] HRESULT GetDirectory();
};
class ATL_NO_VTABLE EDCService :public IFileIO
{
public:
EDCService()
{
}
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
return S_OK;
}
void FinalRelease()
{
}
public:
STDMETHOD(GetFile);
STDMETHOD(GetDirectory);
}
Hi friends ...
STDMETHOD(GetFile);
STDMETHOD(GetDirectory); these two methods definitions are written main.cpp
i doing so many try's to solve this prob..first i create instance of EDCService.like
EDCService edcobj;
then i create instance of EDCService like
edcobj.CreateInstance(); but showing..
When i compile this code i get the follwing errors i dont know how was solve it
error C2039: 'CreateInstance' : is not a member of 'EDCService'
error C2259: 'EDCService' : cannot instantiate abstract class
Please tell me how to solve this problem ..
|
|
|
|
|
Sakthi_Vel wrote: then i create instance of EDCService like
edcobj.CreateInstance(); but showing..
When i compile this code i get the follwing errors i dont know how was solve it
error C2039: 'CreateInstance' : is not a member of 'EDCService'
You aren't supposed to create an instance that way. If you are inside your program, you could use CComObject<edcservice>::CreateInstance. To create it from a client, you would normally assign a class ID to EDCService and the use CoCreateInstance.
Sakthi_Vel wrote: error C2259: 'EDCService' : cannot instantiate abstract class
IDispatch has four pure virtual methods that you can implement by deriving EDCService from IDispatchImpl. IDispatch derives from IUnknown which has three more methods, which are implemented in CComObject. Also you need an interface map for EDCService so that CComObject::QueryInterface can work correctly.
Sakthi_Vel wrote: //Main.h
__interface IFileIO : IDispatch
{
[id(1), helpstring("method GetFile")] HRESULT GetFile();
[id(2), helpstring("method getDirectory")] HRESULT GetDirectory();
};
This looks like attributed ATL. You really don't want to use it. Attribute support for standard C++ is much weaker than for .net, and I've found that (at least with VS2003) that it has an extreme problem with interface dependancies, because the generated .idl file neither forward declares types, nor attempts to put them in an order which wouldn't need it. To do anything significant with ATL, you'll need to learn IDL.
Nathan
|
|
|
|
|
I don't know where to report this bug, so may be this is the right place...
If you set an IDocHostUIHandlerDispatch -interface the FilterDataObject -Method of CAxHostWindow does NOT query the IDataObject -interface from the returned IUnknown , instead it calls QueryInterface on it self:
if (m_spIDocHostUIHandlerDispatch != NULL)
{
CComPtr<iunknown> spUnk;
hr = m_spIDocHostUIHandlerDispatch->FilterDataObject(pDO, &spUnk);
if (spUnk)
hr = QueryInterface(__uuidof(IDataObject), (void**)ppDORet);
if (FAILED(hr) || *ppDORet == NULL)
hr = S_FALSE;
}
</iunknown>
So the line
hr = QueryInterface(__uuidof(IDataObject), (void**)ppDORet);
should be more like:
hr = spUnk->QueryInterface(__uuidof(IDataObject), (void**)ppDORet);
Does anyone know where to report this bug?
Greetings,
imagiro
|
|
|
|
|
|
Thanks Mike. Looks like reporting bugs is sometimes harder than finding them
|
|
|
|
|
Hi All,
I have developed the project in ATL in which I am getting events from the browser window through Invoke() function of the IDispatch interface.
And my question is that I want to get Mouse Click event with the element id on which event has been fired.How can I do that?
I tried below code to do the same but I m not getting success.
<br />
<br />
STDMETHODIMP CSimpleTab::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,<br />
DISPPARAMS* pDispParams, VARIANT* pVarResult,<br />
EXCEPINFO* pExcepInfo, UINT* puArgErr)<br />
{<br />
switch (dispIdMember)<br />
{<br />
case DISPID_HTMLELEMENTEVENTS2_ONMOUSEDOWN:<br />
{<br />
CComVariant dis_event;<br />
dis_event = (CSimpleTab *)(this);<br />
<br />
IDispatch *lpDispatch = pVarResult->pdispVal;<br />
IHTMLEventObj * eventObj;<br />
HRESULT hr = lpDispatch->QueryInterface(IID_IHTMLEventObj,(void **)&eventObj);<br />
<br />
IHTMLElement * element;<br />
eventObj->get_srcElement(&element);<br />
}<br />
}<br />
}<br />
in above code I m getting null in to the pVarResult->pdispVal parameter.
Do you have any idea why does this happen?
Thanks in Advance.
Ashish Bhatt,
Indianic,Ahmedabad.
|
|
|
|
|
I am new to ATL. How to display a message box in ATL projects?
|
|
|
|
|
Sakthi_Vel wrote: I am new to ATL. How to display a message box in ATL projects?
::MessageBox(NULL,_T(""),_T(""),MB_OK); same like any win32 project
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
|
Another WinApi wrapper function AtlMessageBox
|
|
|
|