|
Hi,
Can anybody help me to get Icon details like its name, target path, working directory whenever it is double-clicked to run the application. This is be using Windows API or in C#.
I have already used IShellLink Interface but its been hard-coded for icon name. Suppose the user changes desktop icon name then also coding should be able to change its working directory. This can be done if I can check the existence of the icon.
Regards.
|
|
|
|
|
Help me on Creating a Crystal report using a predifined template with vc++ 6.0
I have tried so many times to create a new report using crystal report 11 by incorporating a template with vc++. I didnot find any article or sample code which is written in c++. But after some effort I got to know that there is a function called put_ReportTemplate() which is used for this task. I already know how to create a new report without using a template.
If anybody can help me by supplying a vc++ code on creating a Crystal report using a predifined template, it will be greatly appreciated.
Thanks.
SabseJugs
|
|
|
|
|
Hi
In com what does stub and proxy indicate?
I think proxy indicate interface file
class IComponent :public IUnknown; right?
What does stub mean?
Thanks.
|
|
|
|
|
In COM, if you create an object in-process you call interface methods directly on the actual object (well technically the object must be in the same apartment but ignore this for now). If the object you're talking to is further away, such as on another machine, this is obviously impossible. In cases like this, when direct a connection isn't possible, proxies and stubs come into play. A proxy is an object that implements the same set of interfaces as the real object and when its methods are called it sends, using whatever communication method is appropriate, information on which method was called and the parameters to the stub which is located near the real object. If the real object is on another machine the network will be used. The stub is an object that receives the data from the proxy and calls into the real object and the sends the return value and any out parameters back to the proxy and thus the client code. The MIDL compiler creates the proxy and stub for you (or info which enables the system to cook some up). Look up marshalling for more details.
Steve
|
|
|
|
|
|
((
fdsfkdsfkdsf
f
dsf
ds
f
dsf
sd
fsd
f
|
|
|
|
|
hi all i want to know,how to be notifid that internet exploer is attaching a file as mail attachment. or it is opening a common dialog box to attach the file basically i want to be notified for such a event, i had tried the Iwebbrowser2 but not found such a enent how to do that.
any ideas i welcomed.
actually i want to block the internet explorer to attach files i had done on hotmail and yahoo by getting the adress barname there was attach work in adress bar when attachement page was going to open, but in gmail adress bar does not changes it adress.
-- modified at 7:01 Thursday 31st August, 2006
Tasleem Arif
|
|
|
|
|
Have you seen this ?
HRESULT IWebBrowser2::put_Silent(VARIANT_BOOL bSilent)
you can suppress dialog boxes.
|
|
|
|
|
but how to be notified that internet explorer is had open common dialog box or it had clicked on what button or link is that is possible to know. i mean where the user had clicked i want to get that text caption or button caption is it possible?
-- modified at 0:44 Friday 1st September, 2006
Tasleem Arif
|
|
|
|
|
tasleem143 wrote: but how to be notified that internet explorer is had open common
If you set silent property, then no common dialog will be invoked,
tasleem143 wrote: i mean where the user had clicked i want to get that text caption or button caption is it possible?
I doubt how it is possible, because I think its altogether different mechanism.
Anyhow , whats problem setting this property, doesn't this solve your problem? You already able to get email page of respective accounts. You just need to set this property to true , once user goes to this page, and set back to false, after getting out of it.
|
|
|
|
|
can you guide me that on which event i should call this function i mean on DISPID_NAVIGATECOMPLETE2 OR behind some other thanks
|
|
|
|
|
hi all,
I am new to ATL|COM .
I have created a COM dll with a sinple function returning a string .
Now i want to access that function from my C++ Application.
Can anyone please help me to create an instance for this dll so that i can call that dll method.
A piece of sample code will be of great help.
Thanks in advance,
Veena.
|
|
|
|
|
Hope this helps you,
HRESULT hr = CoInitialize(NULL);
IMyInterface *pIMy;
if (SUCCEEDED(hr))
{
hr = CoCreateInstance(CLSID_CMyIterface,
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(IMyInterface ),
(void **) &pIMy);
if (FAILED(hr))
{
CoUninitialize();
}
else
{
pIMy->MyFunction();
}
}
CoUninitialize();
|
|
|
|
|
do following steps
1. #import .tlb file in your client application. you will find this file in the folder of your com project.
2. Following code should solve your problem.I haven't done any error checking in following
code.
BSTR name;
CoInitialize( NULL );
IExpressionData* pOutputData = NULL;
hResult = CoCreateInstance(CLSID_CExpressionData //replace with your CLSID
, NULL
, CLSCTX_INPROC_SERVER
, IID_IExpressionData /replace with your IID_
, (void**)&pOutputData);
hResult = pOutputData->your_method( &name );
CoUninitialize( );
satindar
|
|
|
|
|
How can i run dos command using dotnet
for example: I want to run following command
Dir D:\*.*
now not only want to run that but the which ever result comes that i want to take in the dotnet windows form, i mean i want to print that result in the textbox OR if it should display directories in the listbox or some thing like that.
So is there any way to do that coz this is very urgent, please help me friends, u have helped me before this as well so please help me now as well
Harshad Pednekar
|
|
|
|
|
Post this question to appropriate forum to get fast reply.
|
|
|
|
|
Hi Prasad
Please tell me what more info u want i will give u that also so u can help
Thankx for replying
Harshad Pednekar
|
|
|
|
|
Hi All,
Am new to COM and i tried creating a COM server and COM client
COM Server is created by inservting ATL COM object in to MFC Dialog based application project
I hav build the Server application successfully then i tried to CoCreateInstance() from the client app. i hav imported the .tlb file and TestCOMMFC_i.h files. But am getting the following link errors
Compiling...
TestClientDlg.cpp
Linking...
TestClientDlg.obj : error LNK2001: unresolved external symbol _CLSID_TestServer
TestClientDlg.obj : error LNK2001: unresolved external symbol _IID_ITestServer
Release/TestClient.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
TestClient.exe - 3 error(s), 0 warning(s)
pls reply asap
thnx in advance
|
|
|
|
|
You should also use the TESTCOMMFC_i.c file, which has the data for these symbols in it. Alternatively, you could use #import on the type library, with the named_guids tag.
If you use the _i.c file, don't forget to change it's settings so that it doesn't use pre-compiled headers.
Steve S
Developer for hire
|
|
|
|
|
Hello!
I'm trying to turn on/off system restore on Windows Vista by
calling methods Enable/Disable of WMI Class SystemRestore.
My program works ok on Windows XP. But when I try to run
it on Windows Vista I don't have the desired result.
The ReturnValue of method ExecMethod equals to RPC_X_NULL_REF_POINTER
(A null reference pointer was passed to the stub).
Can anyone help me and tell what's wrong.
Here is the code of my program
<br />
<br />
HRESULT hres;<br />
<br />
hres = CoInitializeEx(0, COINIT_MULTITHREADED); <br />
if (FAILED(hres))<br />
{<br />
cout << "Failed to initialize COM library. Error code = 0x" <br />
<< hex << hres << endl;<br />
return 1;
}<br />
<br />
hres = CoInitializeSecurity(<br />
NULL, <br />
-1,
NULL,
NULL,
RPC_C_AUTHN_LEVEL_DEFAULT,
RPC_C_IMP_LEVEL_IMPERSONATE,
NULL,
EOAC_NONE,
NULL
);<br />
<br />
<br />
if (FAILED(hres))<br />
{<br />
cout << "Failed to initialize security. Error code = 0x" <br />
<< hex << hres << endl;<br />
CoUninitialize();<br />
return 1;
}<br />
<br />
IWbemLocator *pLoc = NULL;<br />
<br />
hres = CoCreateInstance(<br />
CLSID_WbemLocator, <br />
0, <br />
CLSCTX_INPROC_SERVER, <br />
IID_IWbemLocator, (LPVOID *) &pLoc);<br />
<br />
if (FAILED(hres))<br />
{<br />
cout << "Failed to create IWbemLocator object. "<br />
<< "Err code = 0x"<br />
<< hex << hres << endl;<br />
CoUninitialize();<br />
return 1;
}<br />
<br />
<br />
IWbemServices *pSvc = NULL;<br />
<br />
hres = pLoc->ConnectServer(<br />
_bstr_t(L"ROOT\\Default"), <br />
NULL,<br />
NULL, <br />
0, <br />
NULL, <br />
0, <br />
0, <br />
&pSvc<br />
);<br />
<br />
if (FAILED(hres))<br />
{<br />
cout << "Could not connect. Error code = 0x" <br />
<< hex << hres << endl;<br />
pLoc->Release(); <br />
CoUninitialize();<br />
return 1;
}<br />
<br />
cout << "Connected to ROOT\\Default WMI namespace" << endl;<br />
<br />
hres = CoSetProxyBlanket(<br />
pSvc,
RPC_C_AUTHN_WINNT,
RPC_C_AUTHZ_NONE,
NULL,
RPC_C_AUTHN_LEVEL_CALL,
RPC_C_IMP_LEVEL_IMPERSONATE,
NULL,
EOAC_NONE
);<br />
<br />
if (FAILED(hres))<br />
{<br />
cout << "Could not set proxy blanket. Error code = 0x" <br />
<< hex << hres << endl;<br />
pSvc->Release();<br />
pLoc->Release(); <br />
CoUninitialize();<br />
return 1;
}<br />
<br />
<br />
BSTR MethodName = SysAllocString(L"Disable");<br />
BSTR ClassName = SysAllocString(L"SystemRestore");<br />
<br />
IWbemClassObject* pClass = NULL;<br />
hres = pSvc->GetObject(ClassName, 0, NULL, &pClass, NULL);<br />
<br />
IWbemClassObject* pInParamsDefinition = NULL;<br />
hres = pClass->GetMethod(MethodName, 0, <br />
&pInParamsDefinition, NULL);<br />
<br />
IWbemClassObject* pClassInstance = NULL;<br />
hres = pInParamsDefinition->SpawnInstance(0, &pClassInstance);<br />
<br />
VARIANT varCommand;<br />
varCommand.vt = VT_BSTR;<br />
varCommand.bstrVal = L"C:\\";<br />
<br />
hres = pClassInstance->Put(L"Drive", 0,<br />
&varCommand, 0);<br />
wprintf(L"The command is: %s\n", V_BSTR(&varCommand));<br />
<br />
IWbemClassObject* pOutParams = NULL;<br />
hres = pSvc->ExecMethod(ClassName, MethodName, 0,<br />
NULL, pClassInstance, &pOutParams, NULL);<br />
<br />
if (FAILED(hres))<br />
{<br />
cout << "Could not execute method. Error code = 0x" <br />
<< hex << hres << endl;<br />
VariantClear(&varCommand);<br />
SysFreeString(ClassName);<br />
SysFreeString(MethodName);<br />
pClass->Release();<br />
pInParamsDefinition->Release();<br />
pOutParams->Release();<br />
pSvc->Release();<br />
pLoc->Release(); <br />
CoUninitialize();<br />
return 1;
}<br />
<br />
<br />
VARIANT varReturnValue;<br />
hres = pOutParams->Get(_bstr_t(L"ReturnValue"), 0, <br />
&varReturnValue, NULL, 0);<br />
<br />
cout << "Return Value: " << V_I4(&varReturnValue);<br />
<br />
<br />
VariantClear(&varCommand);<br />
VariantClear(&varReturnValue);<br />
SysFreeString(ClassName);<br />
SysFreeString(MethodName);<br />
pClass->Release();<br />
pInParamsDefinition->Release();<br />
pOutParams->Release();<br />
pLoc->Release();<br />
pSvc->Release();<br />
CoUninitialize();<br />
<br />
getchar();<br />
return 0;<br />
<br />
|
|
|
|
|
Hi
I am reading an article author said:
"Windows lets you share code at the binary level using DLLs. After all, that's how Windows apps function - reusing kernel32.dll, user32.dll, etc. But since the DLLs are written to a C interface, they can only be used by C or languages that understand the C calling convention. This puts the burden of sharing on the programming language implementer, instead of on the DLL itself."
[url]http://www.codeproject.com/com/comintro.asp[/url]
Are user32.dll ,kernel32.dll... COM dlls or are they only written in c interface?
I they only written c interface how can other programming languages use these system32 dlls?
|
|
|
|
|
No, they provide a 'flat' interface - no understanding of objects. Any language implementation on the Windows platform has to understand the Windows C-language Application Binary Interface (ABI), otherwise they simply could not produce working programs.
However, the C++ ABI is not standardised and therefore linking C++ programs with DLLs compiled with a different C++ compiler is unlikely to work. In practice you can normally manage to link a C++ program and DLLs with different versions of the same compiler. Otherwise you have to define a 'flat' interface on the C++ DLLs.
COM defines an ABI for calling between objects.
|
|
|
|
|
Thank you very much Mike Dimmick.
Can you plase explain what the meaning of 'flat' interface.
Can you please give me an example or your experience about c++ ABI and DLLs compiled with a different C++ compiler is unlikely to work.
I think this is perfect explanantion but i am beginner so i don't understand it totally.
Can you plase give me more details.
Thanks again...
|
|
|
|
|
sawerr wrote: Can you plase explain what the meaning of 'flat' interface.
Can you please give me an example or your experience about c++ ABI and DLLs compiled with a different C++ compiler is unlikely to work.
1. Flat interface means no C++ style classes, eg Window::Close(), instead there are just functions - CreateWindow(), CreateFile()*, CloseHandle() etc.
2. If you have a library or DLL built using VC++, it's unlikely to link correctly against code compiled using a different C++ compiler. In many cases, things like MFC extension libraries are now supplied in multiple flavours, VC6, VC.NET, VC.NET 2003, and VC 2005. A former colleague of mine struggled for ages to get a C++ class compiled with Borland to link with VC++. In the meantrime, I'd implemented a rewrite of the relevant code
* Actually, it's CreateFileA and CreateFileW on WinNT, Win2K, WinXP and Server 2003, while WinCE has only CreateFileW, but that's a different question...
Steve S
Developer for hire
|
|
|
|
|
Hi
I've got a situation where as the title of this request suggests I'm embedding an ActiveX control (IsoView) into an ActiveX control I'm writing (to simplify the interface for out JavaScript boys).
I didn't have any trouble instantiating the control but how to embed it in the ActiveX control when there's no form to set it in is a bit of a mystery to me.
So, how do I dynamically embed an ActiveX control on a window.
Thanks for any help
Tom
|
|
|
|
|