|
How to use FindResourceEx for multiple dialog resources for different languages.
|
|
|
|
|
hi,
im coding an Add-In (Visual C++) that do some changes to the document files in Visual Studio (.NET).
in the code i need to get the Active Project that in the solution explorer (the one that will run when the project is execute).
how can i do that?
in MFC i think , in the class IApplication, there's ->get_ActiveProject,
but in the classes of EnvDTE there's not (i didn't find).
does anyone know about something like that? or is there another way to know which is the active/startup project?
thanks in advance,
Avi.
|
|
|
|
|
Looking at a (good) sample add-in that comes with source code(Fast Solution Build by Joshua Jensen[^]), it looks like:
The DTE has a property called Solution, which has a property called SolutionBuild, which has a property called StartupProjects. This is the list of startup projects for the solution.
HTH!
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
|
Hallo,
I’m facing a winlogon/Notify problem.
I’m creating to Winlogon Notification Package. I have therefore written an ATL DLL with a winlogonevent handler function. I exported the winlogon event handler function with the “MyProjectName.def” file as follows
LIBRARY "MyProjectNamaePS"
EXPORTS
DllGetClassObject PRIVATE
DllCanUnloadNow PRIVATE
GetProxyDllInfo PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE
fLogonEventHandler PRIVATE
fLogoutEventHandler PRIVATE
From the fLogonEventHandler function I’m doing the following things
void fLogonEventHandler (PWLX_NOTIFICATION_INFO pInfo)
{
LPCTSTR lpTestValue;
HKEY hk;
DWORD dwData, dwDisp;
TCHAR BufSubkey[MAX_PATH];
LPTSTR MyTestValue;
long HRESULT;
BOOL BRESULT = 0;
LPCTSTR lpCaption;
TCHAR msg[128];
lpCaption = TEXT("OK");
wsprintf(msg, "It's OK!");
MessageBox(NULL, msg, lpCaption, MB_OK);
dwData = 1;
MyTestValue = TEXT("Test Value\n");
wsprintf(BufSubkey,"MyTESTCONTROL"\\TEST");
HRESULT = -1;
HRESULT = RegCreateKeyEx(HKEY_CURRENT_USER,
BufSubkey,
0,
NULL,
REG_OPTION_NON_VOLATILE,
KEY_WRITE,
NULL,
&hk,
&dwDisp);
if (HRESULT == ERROR_SUCCESS)
{
HRESULT = RegSetValueEx(hk,
MTestValue,
0,
REG_DWORD,
(LPBYTE)&dwData,
sizeof(DWORD));
}
}
I registered the dynamic library on a terminal server and used Regmon.exe and filemon.exe to monitor the logon event on the server, and I created the registry entries inside the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\MyProjectname" subkey to register my dll.
Asynchronous = REG_DWORD 1
DllName = REG_SZ MyProjectname.dll
Impersonate = REG_DWORD 0
Logon = REG_SZ fLogonEventHandler
It appeared that the library was called at logon. But I did not seen the massage box and the user did not had in his registry the entry as it has to be.
Can anyone point me please to what I’m doing wrong?
Thanks a lot for your help.
dabayi
|
|
|
|
|
Never did the Winlogon packages, but I would say, that the messagebox is displayed on another console. And because it's waiting for OK clicking, the registry writing code is never executed.
|
|
|
|
|
Thanks a lot for your answer. It think also that the messagebox is displayed in another console. But nothing is also happened when I write the registry entries before call the messagebox. I things I have first to log on the user and then create a process with his tokon.
I will appreciate any help in this direction.
dabayi
|
|
|
|
|
Ah sorry, didn't checked the code behind the MsgBox
Yes, you're right - you cannot write to the registry as it is. That's because your'e trying to write to HKCU which is impossible in the current situation - there's no current user in context of winlogon package. You might try to use the HKCR or HKLM -that should work.
|
|
|
|
|
Thanks a lot for your help geo_m.
I get it. The problem was that I forgot to use __stdcall option to declare the exported functions.
A last question. Do u have an idea how to pass an nt service parameters?
Thanks
|
|
|
|
|
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!
|
|
|
|