|
I see. For my info, writing to HKCU works in that situation?
Regarding your last question, AFAIK parameters are passed to a service just as they are to any C program. For the service, use the ServiceMain function that
you specified for your service. It has two parameters - argc and argv :
void WINAPI MyServiceMain(DWORD argc, TCHAR* argv[])
{
}
This is the same as main() in a C program:
- argc is the number of arguments.
- argv is an array of strings containing the service name and the parameters.
|
|
|
|
|
Does anyone know if there is a similar function to EscapeToCString in WTL? I have XML as a string and need to make sure that problem characters ('&', '<', '>', etc.) are converted before sending as part of a URL. My MFC version used EscapeToCString to do this, but now that we have converted to WTL, I have not been able to find anything to replace it with.
<small>Some people see things that are and ask, Why? Some people dream of things that never were and ask, Why not? Some people have to go to work and don't have time for all that ...
Author: George Carlin
</small>
|
|
|
|
|
showe wrote:
Does anyone know if there is a similar function to EscapeToCString in WTL?
Not that I know of. But you can easily port the function into using ATL's CString as it's the same string as in MFC.
If you are using VC6 (and ATL3), you can use WTL's version of CString which is compatible with MFC's implementation.
--
My name in Katakana is ヨレゲン.
My name in German is Jörgen.
I blog too now[^]
|
|
|
|
|
Isn't EscapeToCString part of ATL Server??? (yes, it's in atlisapi.h) In which case, can't you use that version? (I'm presuming you're using VC++.NET!)
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Thanks, Stuart.
When it came up in help as an MFC function, I guess I wasn't thinking it could be something common to MFC and ATL, but the file is in the mfcatl include directory. It didn't compile without a specific include of the file without MFC, so I assumed I could not use it. You know what that makes me!
Susan Howe
Some people see things that are and ask, Why? Some people dream of things that never were and ask, Why not? Some people have to go to work and don't have time for all that ...
Author: George Carlin
|
|
|
|
|
I am new to ATL/C++ and COM. I am trying to recreate VB User Controls in C++ as ActiveX controls. The ATL Composite Control is the only way I've found to do this so far.
1). I use the New Project Wizard to create a new ATL COM project with MFC support.
2). I add an ATL Composite Control with Control Points Enabled and add a Textbox and a Button.
3). Now I just want to set a member variable to the text control so I can say m_Text1.SetWindowsText("something");
4). But when I go into the Class Wizard, it asks if I want to create a class. I say yes, create a CDialog class, and can add the member variable.
5). Then, I go to the composite control, add an event handler to the button click, and it says "m_Text1" identifier is not found.
How do I add a usable member variable to a control on an ATL Class Wizard??
(I can use SetDlgMessageText, but that is not a good long term solution becuase I need access to any property of any control that I put on one of these).
And lastly, is there an easier way to accomplish this than what I am doing? I can't find a way to make a composite using the MFC ActiveX wizard.
Thanks in advance,
Matt Brown
|
|
|
|
|
Hi all!
I am trying to develp an ATL COM type library using Visual C++ 6.0 which can then be used in Visual Basic 6.0
The class hierarchy is as follows:
CoClass A ----> Main File Handle
Class B ----> Collection of type B1 objects in the file. This is returned as a property of the object A
Class B1 ----> Return type of B
I should be able to do something like this in Visual Basic:
Sub module1()
Dim hA as A
Dim hB as B
Dim hB1 as B1
Set hA = New A
hA.FileName = "C:\temp\xyz.xyz"
Set hB = hA.B
For Each hB1 in hB
Debug.Print hB1.Name 'Name is a property of B1
Next
End Sub
I tried the article "Building Rich Components using ATL COM" on this website
But it pertains more to Visual C++ 7.0
Could anyone send me a sample code of how to get around this issue?
I need it really urgently!
Regards,
Neeraj
|
|
|
|
|
Hi there!
I have a problem regarding how to expose a function-parameter as a 'xs:datetime' in a WSDL-file from a ATL-Webservice.
I know that ATL7 doesn't support this type per default - instead one should expose the function parameter as a BSTR, e.g.:
[soap_method]
STDMETHOD(TestFunc)(BSTR MyDate, BSTR* bstrOut);
- but this results in that the WSDL for the method exposes the parameter 'MyDate' as a string (as it should). Now one could just change the WSDL afterwards to convert the parameter to a xs:datetime - but this would get broken each time one recompiles - so this isn't the best option. I have looked through the MSDN-samples - but haven't (yet) found any way to do this.
I have an idea that one could 'play around' with the "[tag_name]"-attribute to build own datatypes - but I'm not that familiar with this attribute (yet).
Does anyone have an idea how to expose a function parameter as a different type than the primitive datatypes?
Best regards,
Michael B. Hansen
|
|
|
|
|
Dear Everybody.
I am trying to port opensource ultr@vnc project to a activeX control. I decided choose ALT to make it.But I don't know how to start, how to use old code as much as possible.I read about ALT tutorial but it seem for bulding a new ALT activex control, not for exist project.
is threre Anyone has any experience.Help me.
Thank you in advance.
|
|
|
|
|
|
for Write the Interface without follow these Steps
!.In the yourProjectname.idl add your custom Interface
@.add a Declaration in ProjectLib column in .idl file and define CoClasss for Interface
#. add a class which will handle you Interface Internally.
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi Alok,
Actually I have to add functionality in a already developed project. The project contains 11 dlls dependent on each other. When i tried to add a class and interface in the DLL through new ATL Class wizard it gives me the error that
error C2065: 'IACurrentReading' : undeclared identifier
Entries of the Interface is in the idl file but still it is not considering it.
All IDs have entries in _i.c file of my project which is created by the compiler with MIDL settings.
Do i need to set any MIDL settings so that the IDs get generated and gets added in the corresponding file
Rits
|
|
|
|
|
Axtaully do one thing
delete _i.c,_p.c dlldata.c and project.h file
and clean the Workspace
and recompile/Build the project and tell me the result
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Actually I got the exact problem and the problem is that I need to run midl with the idl file of project but when i give command
midl readingmanager.idl
It gives error
error MIDL2025 : syntax error : expecting a type specification near "HRESULT"
MIDL compiler version is 5.01.0164 and it is not a problem of updating visual studio bacause previously the file was complied with the same compiler.
Rits
|
|
|
|
|
Send me your your IDL file , i think i will check out myself what the problem is
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
I m trying to get the selected date from the outlook calender.
But when i get the explorer and try with selection object, even though i selected few dates in the outlook calender, the selection object count shows 0.
I need to get the selected dates only not the appointments for those dates.
Can anyone help me.
Thanks in advance!
|
|
|
|
|
hi!
i m going to work on a project where i have to create an activex control for MS Word and Excel. which i will use to read any type of data (Supported by MS Word and Excell) from MS Word and Excel for some manipulation on it. can any body help me to find out some walkthrough or any type of help useful for me.
thanx.
Ahmad Jalil Qarshi
|
|
|
|
|
You have some solutions:
1 You can write plugin-addin for MsWord & MsExcell , you must implements IDExtensibility interface.(The client machine must have MSExcel-MsWord install)
2 You can access from MsWord.Application & MsExcel.Application COM class (The client machine must have MSExcel-MsWord install).
3 You can Access with ADO (ACtivex DAta Object) connecting with msexcel a database.(The client machine must have MDAC install, Win98SE-Win2k-WinXP go in install)
You choose that you prefer..
I am sorry for my bad english.
Good Lucky!
|
|
|
|
|
Hi,
I have a toolbar and I am trying to access the IWebBrowser2 in WM_LBUTTONDOWN, when someone clicks on a control on my toolbar with the following code:
BSTR bstrUrl;
CComPtr<iwebbrowser2> browser;
browser->get_LocationURL(&bstrUrl);
I am getting a debug assertion failed!
p!=0
I know there should be more to the code. Can somebody help?
|
|
|
|
|
Hi
Assuming p refers to the interface pointer in CComPtr, you need to initialise it first - CComPtr needs to hold a valid reference to an IWebBrowser2 interface.
HTH
Martin
|
|
|
|
|
Sorry, but how would I initialize it? I am a newbie to ATL. Sorry, I forgot to mention that I have instantiated a webbrowser object in the toolbar class in another file with:
IWebBrowser2* m_pBrowser;
|
|
|
|
|
Nice question =)
Here is an example of 'SetSite' function for your toolbar.
So, you will get IWebBrowser2* to m_pWebBrowser variable.
IWebBrowser2 * m_pWebBrowser;
...
STDMETHODIMP CToolBarImpl::SetSite(IUnknown* pUnkSite)
{
...
IServiceProviderPtr pServiceProvider = pUnkSite;
if (m_pWebBrowser) m_pWebBrowser = NULL;
if (FAILED(pServiceProvider->QueryService(SID_SWebBrowserApp, IID_IWebBrowser2, (void**)&m_pWebBrowser))) return E_FAIL;
if (m_pWebBrowser==NULL) return E_INVALIDARG;
...
return S_OK;
}
|
|
|
|
|
Thanks for the reply.
My toolbar class already has a SetSite function that basically does what your function does. I, however, also have a seperate file that is used the by the toolbar. The file is a non-class, with a function that converts a Static control into hyperlink, and then when the hyperlink is clicked, it does a ShellExecute to send you to a certain url.
Problem is, in that function that sends you to the certain, I need to obtain the browser object to do a get_LocationUrl, which is what I've been having problems with.
|
|
|
|
|
Hi,
can anyone tell me how macromedia does their silent install of the flashplayer?
thanks
badi
|
|
|
|
|
You have flash.ocx or swflash.ocx sw(shockwave)component ActiveX distribuited for Macromedia , you must do in your instalation regsvr32 /s flash.ocx..
Instance Interface ocx .. Call methods & properties ... is easy
Good Lucky!
Sorry for my bad english.
I hope that You can excuse me )
|
|
|
|