|
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!!
|
|
|
|
|
Hello,
Just try to create ATL Project and add ATL Full Control. Please reed ATL Tutorial on MSDN for more details.
Regards
|
|
|
|
|
Hi~
I am programming a customized web browser with IWebBrowser2 in windows ce 5.0
And I want to embody some functions which copy/cut/paste.
I made it in Win32 Application already..
Using by these ways
Way1
HRESULT hr = m_pWeb->ExecWB(
OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT, NULL, NULL);
if (FAILED(hr))
{
int n = GetLastError();
ASSERT(false);
}
Way2
IHTMLDocument2 *pHtmlDoc;
hr = pDispatch->QueryInterface<ihtmldocument2>(&pHtmlDoc);
EHResult::CheckException(
L"CMainFrame.Copy.QueryInterface<ihtmldocument2> Fail (0x%08x)", hr);
IHTMLSelectionObject *pHtmlObj;
hr = pHtmlDoc->get_selection(&pHtmlObj);
EHResult::CheckException(L"CMainFrame.Copy.get_selection Fail (0x%08x)", hr);
{
IDispatch *pRange;
hr = pHtmlObj->createRange(&pRange);
EHResult::CheckException(L"CMainFrame.Copy.createRange Fail (0x%08x)", hr);
IHTMLTxtRange *pText;
hr = pRange->QueryInterface<ihtmltxtrange>(&pText);
EHResult::CheckException(
L"CMainFrame.Copy.QueryInterface<ihtmltxtrange> Fail (0x%08x)", hr);
VARIANT null;
VariantInit(&null);
VARIANT_BOOL isOk;
hr = pText->execCommand(L"Copy", VARIANT_FALSE, null, &isOk);
EHResult::CheckException(L"CMainFrame.Copy.execCommand Fail (0x%08x)", hr);
}
But It doesn't work in windows ce 5.0 -0-
What should I do now~
And I have one more trouble.
I have to control the element's focus (in html document like ANCHORs or
CONTROLs) by arrow key.
Is there a way get the current focus of elements??
It also possible to get in Win32 by pHtmlDoc->get_activeElement
But Win CE 5.0 -0-
Please Help me~
Thank you.
|
|
|
|
|
I have a .lib generated in VC6. How can i create a COM wrapper for this lib( with some related .h files), which can be used within a VC8 application. Since i am not much aware of COM wrapper,please help me with some details....
|
|
|
|
|
If you want to access the exported methods from Managed C++ then I beleive you may want to look at Interoperability topic in .NET.
Following may be helpful, if you require a COM wrapper over existing DLL -
1. Create a new ATL COM DLL project
2. Add a simple ATL object
3. Add methods [and properties, if required] to the interface of this object. These methods [and properties] correspond to the methods in your DLL. You have the declaration in the .H file already
4. Implement these methods [and properties]. Usually you will only call the exported function of your DLL from each method.
Let me know if this helps. Anyone who knows more specific or can correct me, please do.
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Thanks...
|
|
|
|
|
How would I distinguish between a normal COM component and an ActiveX control by looking at the code?
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
It’s rather simple to write an unmanaged C++ application that crashes when it performs a callback. It’s impossible to write a managed application that does the same, thanks to delegates. - Jeff Prosise
|
|
|
|
|
From MDSN:
At a higher level, an ActiveX control is a COM object that implements several main ActiveX technologies, including regular incoming COM interfaces, the OLE embedding protocol, connection points, and property pages. At a lower programmatic level, ActiveX controls are just COM classes implementing certain families of interfaces. When some client code successfully queries for one of these interfaces, the client code then knows it's dealing with an ActiveX control.
The interfaces exposed by an ActiveX control fall into three general categories. First, ActiveX controls are embeddable objects; that is, they implement most of the OLE Document in-place activation and embedding protocols. ActiveX controls implement the following interfaces: IOleObject, IPersistStorage, IDataObject, IOleInPlaceActiveObject, IOleInPlaceObject, IViewObject2, and IRunnableObject (this is rarely used). Second, ActiveX controls usually support property pages so the client has a means of modifying the control's properties. Finally, ActiveX controls usually implement outgoing interfaces that the client can find out about using COM's connection point technology.
So basically you can determine if it's an ActiveX control by what interfaces it's exposing and whether it has a property page or not.
I got the text from this article[^].
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
|
HakunaMatada wrote: Dunno why I didn't look up MSDN
Nah, you've got to know what to look for as well.
I knew you can tell from the interfaces, but couldn't remember them, and I wanted some writings to refer to.
No worries, mate!
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
Can i know how to ping remote systems on windows 2000 professional operating system using WMI can u please provide example in C++.
i have the following script example
strComputer = "PC1;PC2;"
sArray = Split(strComputer, ";")
strDomain = "WOrkArea"
strUser = InputBox("Enter user name")
strPassword = InputBox("Enter password")
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
For each Machine in sArray=
Set objWMIService = objSWbemLocator.ConnectServer(strComputer, _
"root\CIMV2", _
strUser, _
strPassword, _
"MS_409", _
"ntlmdomain:" + strDomain)
Set colProcessList = objWMIService.ExecQuery _
("SELECT * FROM Win32_Process WHERE Name = 'notepad.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
Next
can u please help with c++ code using WMI to run on Windows 2000 professional
Thanks in Advance
abhi
|
|
|
|
|
Hi all ,
I have just started doing COM , I have Written a Code for popup
blocker(I have given it below) .
Whenever a new popup comes the control will call Invoke Method
and goes inside "case DISPID_NEWWINDOW2" and execute
pdispparams->rgvarg[0].pvarVal->vt = VT_BOOL;
pdispparams->rgvarg[0].pvarVal->boolVal = VARIANT_TRUE;
these codes but after this an unhandled exception is coming and I am unable to
do something on it . why it is coming and is there any problem with my code.
I have given all the codes in Implementation file below . Please help me
/////////Code starts here//////////////////
CComQIPtr<iwebbrowser2, &iid_iwebbrowser2=""> m_spWebBrowser2;
CComQIPtr<iconnectionpointcontainer,
="" &iid_iconnectionpointcontainer=""> m_spCPC;
IConnectionPointContainer* connectionPointContainer;
STDMETHODIMP CMyBhoExp::SetSite(IUnknown* pUnkSite)
{
m_spWebBrowser2 = pUnkSite;
if (m_spWebBrowser2 == NULL)
return E_INVALIDARG;
// Retrieve and store the IConnectionPointerContainer pointer
m_spCPC = m_spWebBrowser2;
if (m_spCPC == NULL)
return E_POINTER;
// Retrieve and store the HWND of the browser. Plus install
// a keyboard hook for further use
//RetrieveBrowserWindow();
// Connect to the container for receiving event notifications
return Connect();
//return hr;
}
STDMETHODIMP CMyBhoExp::GetSite(REFIID riid, void **ppvSite)
{
HRESULT hr;
return hr;
}
HRESULT CMyBhoExp::Connect(void)
{
HRESULT hr;
DWORD m_dwCookie;
CComPtr<iconnectionpoint> spCP;
// Receives the connection point for WebBrowser events
hr = m_spCPC->FindConnectionPoint(DIID_DWebBrowserEvents2, &spCP);
if (FAILED(hr))
return hr;
// Pass our event handlers to the container. Each time an event occurs
// the container will invoke the functions of the IDispatch interface
// we implemented.
hr = spCP->Advise( reinterpret_cast<idispatch*>(this), &m_dwCookie);
return hr;
}
HRESULT CMyBhoExp::Invoke(DISPID dispidMember,REFIID riid, LCID lcid, WORD wFlags,DISPPARAMS * pdispparams, VARIANT * pvarResult,EXCEPINFO * pexcepinfo, UINT * puArgErr)
{
switch(dispidMember)
{
//Pop up blocker
case DISPID_NEWWINDOW2:
TRACE("Pop Up Blocked");
pdispparams->rgvarg[0].pvarVal->vt = VT_BOOL;
pdispparams->rgvarg[0].pvarVal->boolVal = VARIANT_TRUE;
break;
case DISPID_DOCUMENTCOMPLETE:
TRACE("\ncase DISPID_DOCUMENTCOMPLETE:");
break;
}
return S_OK;
}
//////////////////////Code ends here////////////////////////
Thanks
George
|
|
|
|
|
Hai All,
How can I minimize , maximize or close my Internet Explorer Main Window
by using Browser Object, that I am recieving in SetSite().
Please Help me
Thanks in Advance
George
|
|
|
|
|
when I use IWebBrowser2::goForward() or goBack() method in thread that begin from overrided SetSite() method, Browser Helper Object with InternetExplorer occur Error window.
"Memory Access Violation..."
why occur this Exception? here is that part of code.
void SensorWorker( LPVOID lParam )
{
USHORT x,y;
int shock, count = 0, exe = 0;
ACCELREPORT data;
if(sensorFunction) {
sensorFunction(&data);
x = data.LatestZeroG_X;
y = data.LatestZeroG_Y;
}
CIESensorMove * bControl = (CIESensorMove *)lParam;
CString str;
CComBSTR bstrURL("http://www.naver.co.kr");
CComVariant vtEmpty;
while(1){
if(sensorFunction != 0){
sensorFunction(&data);
shock = (int)data.LatestAccelDataY - (int)y;
if(shock == 0 ) exe = 0;
if(bControl->m_spWebBrowser2 != NULL && exe == 0)
str.Format("%d", count);
if( shock > 3 ){
// bControl->m_spWebBrowser2->GoForward();
bControl->goForward();
count++;
exe = 1;
bControl->m_spWebBrowser2->put_StatusText(str.AllocSysString());
// bControl->m_spWebBrowser2->Navigate(bstrURL, &vtEmpty, &vtEmpty, &vtEmpty, &vtEmpty);
Sleep(200);
}else if (shock < -3){
// bControl->m_spWebBrowser2->GoBack();
bControl->goBack();
count--;
exe = 1;
bControl->m_spWebBrowser2->put_StatusText(str.AllocSysString());
Sleep(200);
}
}
Sleep(100);
}
}
|
|
|
|
|