|
Shailesh Halankar wrote: ABOVE the IID_Control is showing as NULL...
I think, you wants to say, m_pControl is NULL.
Can you show complete code ?
Have you used ::CoInitialize(NULL) before calling CoCreateInstance ?
|
|
|
|
|
Hello
ur right m_pControl is NULL ..hence error..
I can giv u some more of the code ...
HRESULT hrStatus = CLSIDFromProgID( TEXT("What ever prog ID"), &clsControl );
if( SUCCEEDED(hrStatus) )
{
//
// Create the object and initialize it.
//
hrStatus = CoCreateInstance(
clsControl,
NULL,
CLSCTX_INPROC_SERVER,
IID_IControl,
reinterpret_cast<lpvoid *="">(&m_pControl)
);
if( SUCCEEDED(hrStatus) )
{
// some code
}
}
|
|
|
|
|
Shailesh Halankar wrote: HRESULT hrStatus = CLSIDFromProgID( TEXT("What ever prog ID"), &clsControl );
if( SUCCEEDED(hrStatus) )
I think you are getting class id here.
Call, ::Coinitialize(NULL) before it.
Shailesh Halankar wrote: hrStatus = CoCreateInstance(
clsControl,
NULL,
CLSCTX_INPROC_SERVER,
IID_IControl,
reinterpret_cast(&m_pControl)
);
What is value of hrstatus here?
|
|
|
|
|
Hi Prasad
I cant use coinitialize function ..gives linker error..i think its coz its not a VC++ apllication that i m working on . Its a Embeded VC++ application that i m working on.
regards
Shailesh
|
|
|
|
|
Shailesh Halankar wrote: ..gives linker error
You need to link Ole232.lib .
Shailesh Halankar wrote: i think its coz its not a VC++ apllication that i m working on . Its a Embeded VC++ application that i m working on.
Doesn't matter.
BTW, you haven't answered my second question , about value of hresult.
|
|
|
|
|
Your code is hard to read. What is the HRESULT returned? Try entering "hr, hr" in your debugger watch window, assuming the variable containing the HRESULT returned from CoCreateInstance is named "hr ". If it was named "MyHr " you'd use the following string: "MyHr, hr".
Steve
|
|
|
|
|
my code ..is somewat like this
HRESULT hrStatus = CLSIDFromProgID( TEXT("some"), &clsControl );
if( SUCCEEDED(hrStatus) )
{
//
// Create the object and initialize it.
//
hrStatus = CoCreateInstance(
clsControl,
NULL,
CLSCTX_INPROC_SERVER,
IID_IControl,
reinterpret_cast<lpvoid *="">(&m_pControl)
);
if( SUCCEEDED(hrStatus) )
{
//some code
}
}
regards
Shailesh
|
|
|
|
|
Put a break point directly after the CoCreateInstance call you're having problems with. When the break point is hit add the following to the watch window: "hrStatus, hr". If all goes well your debugger will tell you what the problem is.
Steve
|
|
|
|
|
Hi Shailesh,
What happens to your problem ?
Its always good practice to reply, whether you problem has been solved or not. It helps other to add this problem to their knowledege.
And reply further if not solved.
|
|
|
|
|
i want to launch an executeable thorugh shell.
can any one help me out ?
|
|
|
|
|
Doesn't this[^] section helps you?
|
|
|
|
|
Hi Andrew,
Thanks for this article, really it is very knowledgeble.
I have downloaded demo project for costum form "A VC++ Outlook COM Add-in that publicizes a custom form" , but when I am giving build in vc++(6.0) editor, it is giving following error :
/******************************/
Compiling...
Addin.cpp
D:\OutlookProject\demo\OutlookAddin_demo\Addin.cpp(59) : error C2665: 'AfxMessageBox' : none of the 2 overloads can convert parameter 1 from type 'const char *'
D:\OutlookProject\demo\OutlookAddin_demo\Addin.cpp(112) : error C2664: '__thiscall ATL::CComPtr<struct office::_commandbarbutton="">::ATL::CComPtr<struct office::_commandbarbutton="">(struct Office::_CommandBarButton *)' : cannot convert parameter 1 from
'long' to 'struct Office::_CommandBarButton *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
/**************************************/
I am not able to solve this error, could you please help me to fix this error.
Note : In my system having outlook 2003
Many Thanks
Abhishek
Abhishek Tiwary
|
|
|
|
|
Hi
i have created a C# DLL in VS2003 and installed it in GAC with WISE installer which actually register the dll in gac and add registry key.
i am calling this dll from vbscript by using createobject method when
i first time installed the dll and access it from script it works fine
but when i change the version number after some updates in the code and install it again its not working
in event log its giving the error for Invalid class string when i call it from vbscript.
i even remove the previous version before new installation and restart my pc.
this happen for all the dlls i m working they all work first time same error after new version of dll
But if i change the ProgId its start working again.
the problem is i dont want to change Progid every time i create new version.
Any help
thanks...alot
Nav.
|
|
|
|
|
Hello,
I’ve developed ATL Control using VC++ 2003 to use it as GUI component for different programming environments. It works fine with .NET and Borland builder, but when I try to use it with VB6 or VC++6 I got ‘Permission denied’ error. It happened when I call ::GetClientRect(m_hWnd, &ClientRect) function, where m_hWnd is a private member of this control (handle of control’s window). What’s wrong? How to fix it?
Regards,
Leonid
|
|
|
|
|
i need to pass a path string to vc++ module in a com component, but i'm having difficulty in working betbeen string of C# and CHAR* of vc++. does anyone have any solution??
i have made an interface(COM) for a function sth like below.
test(CHAR* path)
{
}
|
|
|
|
|
Hello,
You need to use BSTR as argument’s type for COM server. Interop takes care about the rest.
Regards,
Leonid
|
|
|
|
|
Hello,
here is a function's signatures for 2 PowerPoint effects event handlers:
SlideShowNextClick(SlideShowWindow Wn,Effect ef)
The effect onNextClick is ef.
SlideShowNextBuild(SlideShowWindow Wn)
What is a current executed effect??
At the moment I have next implementation:
1. By handle SlideShowNextClick store next effect name ("xyz").
2. By handle SlideShowNextBuild execute my bussiness logic (for effect "xyz").
The problem occurs if the current slide has more than 1 effect on page and "go back" button will be used. ==> I can't catch "goback"-event, thus I can't be sure that my stored "NextEffect" is a next effect realy.
Is it possible to get number/name of current executed effect directly in SlideShowNextBuild handler?
Many thanks for your help.
|
|
|
|
|
I have an encrypted string like one below
óðØÐÕ“Ðí¼Q‰ð¿GäšÉ²xq¯‡#D
Ù(=×-Åñׇòu𞇩5O™ß½õXê&g"²Áy;‹í
"qÃgø)tý)KŽTÄbÀ Asï°ªñ5g3C`èì^Þn|qt†ò4²{q`Bòåm…
i want to pass this to an ATL com component from asp and save the same thing in a text file from the component
i put this entire string in an array as below in vbscript
myData = óðØÐÕ“Ðí¼Q‰ð¿GäšÉ²xq¯‡#D
Ù(=×-Åñׇòu𞇩5O™ß½õXê&g"²Áy;‹í
"qÃgø)tý)KŽTÄbÀ Asï°ªñ5g3C`èì^Þn|qt†ò4²{q`Bòåm…
Redim BinArray(LenB(myData))
For I = 1 To LenB(myData)
BinArray(I-1)=MidB(myData, I, 1)
Next
i am passing to com component with the statement
dllObj.ProcessData(BinArray)
dllObj is com component
Method inside the component is
STDMETHODIMP CKey::ProcessData(VARIANT *data, BSTR *success)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
HRESULT hr;
_variant_t vtArray (data);
VARTYPE vt = V_VT(&vtArray);
if (vt & VT_ARRAY)
{
long lLBound, lUBound;
SAFEARRAY * psa;
// copy variant array to SAFEARRAY
SafeArrayCopy(*(vtArray.pparray), &psa);
SafeArrayGetLBound(psa, 1, &lLBound);
SafeArrayGetUBound(psa, 1, &lUBound);
for (long loopCnt = lLBound; loopCnt
|
|
|
|
|
Argument in .idl should be like this: [in,out] SAFEARRAY(BYTE)* pData. In .h and .cpp it should be: SAFEARRAY** pData.
Regards
|
|
|
|
|
i am a final year student in b.tech(computer science)..i would like to get some interesting topics in .net & c# so that i could carry it on as my main project(which is a part that is compulsory in our syllabus)..
dasdsd
|
|
|
|
|
how to ping remote system running on Windows 2000 using WMI
is there any patch for windows 2000 to ping remote system using win32_pingstatus class
thanks
abhi
|
|
|
|
|
Hai All,
I have made an InternetExplorer toolband .
In that I can fix the size of toolband in GetBandInfo() function
using the structure DESKBANDINFO .
But I need to change the size of my toolband in a function other than
GetBandInfo(), is it possible.
Thanks
George
|
|
|
|
|
Hai all,
I am doing a Programme in COM. That will retrieve the x,y Position of all the
HTML Element Collections ,
I have done upto getting HTML Element Collections using IHTMLElementCollection
Interface.
That means I have a pointer of IHTMLElementCollection that contains all the
HTML Element Collections .
But now How I can take X and Y positions of these elements. Or is there any
other way of taking these things.
Please Help me.
Thanks in Advance
George
|
|
|
|
|
I have failed to figure out how to use a third party control.
I downloaded this
http://www.codeproject.com/cs/miscctrl/CollapsibleGroupBox.asp?df=100&forumid=68831&exp=0&select=1648587#xx1648587xx
Added the DLL as a reference.
I cant see the control on the tool box.
Forgive me, I'm totally new
|
|
|
|
|
Hi I am a newbie with COM & ActiveX and would like to ask for some advice.
I'm developing a GUI for real time systems, written in ANSI C and C++, it will provide drawing functions, a windowing system, widgets, bitmaps etc.
I want to add a possibility to use it aswell as an ActiveX control, so people can create a VisualC++ project and develop on it as a way of simulating the real hardware. So the ActiveX control should display what at the end will be seen in a real screen running the GUI in an embedded real time system.
Any hints on the best way to do this? I am just starting my research on ActiveX possibilities. My first thought is to use an ActiveX dialog with a picture control on it the size of the real screen. Then make it get the picture content from a memory area provided by the container application. When the container changes that memory, changes should be displayed in the ActiveX picture. Should the picture control be a bitmap or a "owner draw" type? Any help will be much appreciated.
Thanx!!
|
|
|
|