|
What about hooking ::SetWindowsHookEx(...) ? Sounds stupid but...
API hook[^].
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
Hi!
I need to catch messages from other applications in my own program
(something like spy++).
When I get the application, but how do I process its messages?
Do you know where I can find an example?
Thanks
Zeljko
|
|
|
|
|
http://www.codeproject.com/useritems/Winspector.asp
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I know this isn't Visual per se, but I thought I'd ask and see....
I writing a little bit of CGI in C, on a Samba Linux web server. I want to use findfirst, but if 'aint implemented!! Anyone know of an alternative, or how to implement it please??
I've used app *.*, and then looked at argv, but in this instance I can't.
Thanks
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
Jeremy Davis wrote:
I writing a little bit of CGI in C, on a Samba Linux web server
Off-topic. Anyway, use opendir() and co.
|
|
|
|
|
|
Dear All,
I'm trying to make a program that looks like installer programmes that displays one dialog box at a time. The user will then just have to chose some options and click Next to the next dialog box. Problem is I do not know where to start and how to structure the program.
Can anyone please help me out here.
Many many thanks in advance
Chun Te, Ewe
|
|
|
|
|
Property pages might be your best bet - then you can keep the same main window open, and just switch between pages when the user clicks the next button
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Hi
So you want to do a wizard: dialog with Next, Prev and Finish button.
All you have to do is to use two classes: CPropertySheet and CPropertyPage. CPropertySheet will be used as a kind of container for the dialogs through which user will be able to iterate. In CPropertySheet look at the functions: SetWizardMode and SetWizardButtons. Add to you program one class that inherites from CPropertySheet and as many as you need classes that inherites from CPropertyPage(one class for every page in wizard). You can find comprehensive explanation in MSDN (start with classes CPropertySheet and CPropertyPage, that should be enoguh).
Greetings
Mariusz Popiolek
|
|
|
|
|
I've just done a similar thing myself. It's easy enough to switch between a normal Property Sheet/Page implementation to a wizard look-and-feel by use of the CPropertySheet.SetWizardMode call before the sheet is invoked, as described in the previous post.
A few things that tripped me up when I was first doing it:
1) the title in a wizard is actually driven from the tab text you would normally see for the property page being displayed, NOT from the property sheet title.
2) The buttons displayed/enabled/disabled need setting from the PropertySheet, not the Page, so although the page is the one that needs to initiate the button display, it is actually the sheet that needs to do it.
3) If you go for the wiz98 type styles (nice bitmap backgrounds) then they change format between mfc6+7!
Debbie
|
|
|
|
|
Err..of course I meant wizard97 styles.
I do have a very simple test project I created in VC++ 6.0 that illustrates how to do this. If you're interested, then email me.
As an aside, I could put this in the archives section, if it would be useful to anyone else, but it is *very* simple, so there might well already be one there already? What are the guidelines behind putting articles in?
|
|
|
|
|
Hi All,
I have encrypted the file by Java Crypto API using DES.
Now i want to decrypt the same file by using DES.
the code for the encryption is:
String strKey="My key";
Cipher desCipher=Cipher.getInstance("DES");
SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("DES");
DESKeySpec desKeySpec = new DESKeySpec(strKey.getBytes());
SecretKey secretKey= secretKeyFactory.generateSecret(desKeySpec);
desCipher.init(Cipher.ENCRYPT_MODE,secretKey );
Then by using the desCipher i encrypt the file.
Now the problem is that i want to decrypt the file by using the DES algorithm in the VC++. I am bound to use the DES algorithm for the the decryption of the file.
Can, any one help me out to solve the problem?
|
|
|
|
|
I use CHtmlView to write my ap. And I use is's printing function.
But the printing result has the url in the paper (in the left-bottom).
How should I do to prevent it to print ?
THX.
|
|
|
|
|
If it's your own IE, then just change your Page Setup, or change the registry.
Otherwise, you got stuff here[^].
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
I need to have ATL and MFC in an object and was wondering about the best order to do this, via the VC++ 6.0 wizards. Is it best to creat an ATL object then add MFC support, or create an MFC object and then add ATL support?
I have looked at the tutorial:
How to use an ATL-control with MFC
By Franky Braem
And he does it with MFCs first, followed by ATL.
I've had conflicting advice from colleagues, and wondered about the advantages/disadvantages of the order. Although it doesn't really matter superficially as long as it works(!), I'd like to feel I understood it more.
Anybody know more about the mechanics of this?
Debbie
|
|
|
|
|
The two don't overlap. But you need to know if you intend to build a stand-alone app, or an ActiveX control.
For a stand-alone app, use the MFC class wizard, because it provides the SDI/MDI framework/dialog. Then separately use the ATL wizard to create a code skeleton, and inject the resulting code in your MFC app.
The ATL ActiveX control wizard uses both ATL and MFC (the class wizard doesn't provide the dov/view framework).
Of course, it is always possible to arrange things to make it work anyway.
MFC are usually shared at run-time (MFCxx.dll automatically loads) : _AFXDLL symbol.
ATL are usually statically linked. (atl.dll does not load unless you add the _ATL_DLL symbol.)
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
I'm afraid my knowledge of activex controls is somewhat limited, but I don't think my objects under development come under that label.
I need two objects (at the moment): One is an executable that provides a dialog box to list available tools (bit like a control panel). The other is a dll that gets listed in that box and gets executed as a modeless dialog box itself. They communicate using a COM interface.
So, if I've interpreted your comments correctly, I would imagine the MFC first approach would be best for these sort of objects?
Incidentally, I did follow the tutorial in CodeProject, and it doesn't use the ATL wizard separately as you've suggested, but it adds an ATL object, and this seems to work ok. Maybe there are overheads, but I'm not that worried about efficiency for this app.
|
|
|
|
|
- for the executable : MFC, dialog-based wizard. You'll instantiate the COM object thanks to CoCreateInstance. Don't forget to initialize COM first : ::CoInitialize(NULL) . No ATL at all here, probably.
- for the DLL : the ATL wizard is just fine. It provides an idl file to work with, and automatical COM registration in the makefile. (ATL samples from the MSDEV cd are helpful as well).
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
How can specify a discontinuous range in the propery 'Values' in a chart serie.
I've tested with: serie->Values = "=E_1!R1C1:R3:C1;E_1!R5C1:R7:C1" but I obtain an error 1004.
Thanks.
|
|
|
|
|
"=E_1!$A$1:$A$3,E_1!$A$5:$A$7"
(used with a French Excel, ie some chars may change).
btw, your formula range has 4 :, which is wrong.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
I've tested this with a combination of english Windows + english office, but I need it work in both, spanish and english systems.
|
|
|
|
|
I have a problem with the macro IMPLEMENT_SERIAL in VC7.
What I have is a BaseDLL containing BaseClass which at compile time is exported from the dll.
class __declspec(dllexport) BaseClass : public CObject
{
DECLARE_SERIAL(BaseClass)
...
}
I also have got a DerivedDLL containing DerivedClass and AnotherClass. At compile time it would look like this
#include <basedll baseclass.h="">
class __declspec(dllexport) DerivedClass : public BaseClass
{
DECLARE_SERIAL(DerivedClass)
...
}
class __declspec(dllexport) AnotherClass : public BaseClass
{
DECLARE_SERIAL(AnotherClass)
...
}
When compiling DerivedDLL, BaseClass has the following look
class __declspec(dllimport) BaseClass : public CObject
{
DECLARE_SERIAL(BaseClass)
...
}
In the implementation file of DerivedClass and AnotherClass I have
IMPLEMENT_SERIAL(DerivedClass, BaseClass, 1)
IMPLEMENT_SERIAL(AnotherClass, BaseClass, 1)
This IMPLEMENT_SERIAL macro doesn't seem to work correctly (although it seems to work in VC6). When adding the classes to the DerivedDLL's list of run-time classes one of the classes is cut off and later on the program can't find the run-time class of AnotherClass.
I've found out that if I exchange BaseClass to CObject it works, but I don't know if it works correctly.
If I move BaseClass from BaseDLL to DerivedDLL it works, but I don't want BaseClass in DerivedDLL.
If I make sure that when compiling DerivedDLL that BaseClass is declared dllexport it works, but it might give me problems later since DerivedDLL doesn't have the implementation code of BaseClass.
Does anyone know why it doesn't work in VC7?
Does anyone have a safe work-around to the problem?
Is there a bug in the VC7 compiler?
|
|
|
|
|
have you put:
IMPLEMENT_SERIAL(BaseClass, CObject, 1)
in the base class?
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
|
Is your .dll 'MFC extension DLL' or rather 'MFC regular DLL'?
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|