|
Michael
Many thanks.
This is much more flexible than my registry hacks.
It works a treat as I use LNKs to run different projects in any case.
Just goes to show one should always check out a program's command line options before complaining about lack of flexibility.
By the way, does anyone know if VS .NET is going to be more flexible in handling project specific settings??
Perhaps even allowing you to define editor color settings for ASM files??
Define a color for virtual spaces??
(The whole VS IDE and editor seems to be several generations behind such tools as Ed for Windows and Codewright in these areas.)
Gary
|
|
|
|
|
I am have just started to teach myself about how to automate Office etc. I have found some knowledge base articles and am working my way throught them. Presently I am looking at Q179706 which talks about automatind Excel. About 30 or so rows into the sample code in the article is the following code snippet
//Format A1:D1 as bold, vertical alignment = centre
range = sheet.GetRange(COleVariant("A1"), COleVariant("D1"));
font = range.GetFont();
font.SetBold(covTrue);
range.SetVerticalAlignment(COleVariant((short) -4108)); //xlVAlignCentre = -4108
range is of type Range and sheet of type _Worksheet
My question is this, how am I supposed to know xlVAlignCentre = -4108? I have searched files on my pc and MSDN for a definition or reference to where it is declared but turned up zip. I have found references to xlvAlignBottom etc on MSDN but nothing to tell me where they are stored or what their value is.
Can anybody help?
Thanks in advance
Richard Ellis
|
|
|
|
|
Neither the SDK or MFC contain that variable name, so I'd suggest that M$ have kindly let us know the hardcoded value of an internally used variable.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Hello, the codegurus around the world.;)
MSFT has some reference of this kind of value.
I remembered that I downloaded some file.
VB has some good example of these values definition.
Try to find Automation sample by VB.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Thanks for the prompt responses Christian and Masaaki
I had feared as Christian suggested but Masaaki's post got me to looking further. I eventually came across Q189265 which listed some Microsoft Graph constants.
Then it said "you can see the constants available with Microsoft Graph by using the OLE - Com Viewer that is available with VC++ in the Platform SDK."
So I did and after a bit of searching I found the constants I was after.
Thanks again for the suggestions
Richard Ellis
|
|
|
|
|
I am a Visual C++ developer and I have been given a project for a hand held device using a National Geode x86 family processor. I have downloaded the embedded Visual C++ evaluation edition. I am able to write an app for CE and emulate it on the CE emulator provided, but for the hand held device do I need to build a version of CE using Platform Builder? I also see Windows CE Toolkit online, what is this? Please help.
|
|
|
|
|
I'm making a program with API (not MFC), and I know how to make a window quite well, but for some reason, more than one is difficult.
I can CreateWindow() more than one window in the Main function, but when I try to do ShowWindow() one of those windows in a Window Procedure, it says the handle of the window Im trying to show is undeclared. And I don't think I can make it global.
How do I make more than one window, and then show or hide them as I please? Any help would be appreciated, thanks =) Dave
|
|
|
|
|
I have been writing a set of classes to create windows dynamically using API, and I found that I had trouble with the Window classes until I removed code to check if the class was already registered. Could you post an example of your code and I'd be glad to try and help more.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Sure, here's some code..
This is MAIN.
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
// define variables
static TCHAR MainClass[] = "GRE",TestClass[]="Test";
static HWND wndMain,wndTest;
MSG msg;
WNDCLASS wndclass,testclass;
strcat(AboutPacer,AboutPacer2);
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH) GetStockObject (LTGRAY_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = MainClass;
testclass.style = CS_HREDRAW | CS_VREDRAW;
testclass.lpfnWndProc = WndProc;
testclass.cbClsExtra = 0;
testclass.cbWndExtra = 0;
testclass.hInstance = hInstance;
testclass.hIcon = LoadIcon (NULL, IDI_APPLICATION);
testclass.hCursor = LoadCursor (NULL, IDC_ARROW);
testclass.hbrBackground = (HBRUSH) GetStockObject (LTGRAY_BRUSH);
testclass.lpszMenuName = NULL;
testclass.lpszClassName = TestClass;
if(!RegisterClass (&wndclass))
{
MessageBox (NULL, "This program requires Windows NT.", MainClass, MB_ICONERROR);
return 0;
}
if(!RegisterClass (&testclass))
{
MessageBox (NULL, "This program requires Windows NT.", TestClass, MB_ICONERROR);
return 0;
}
//Create all windows
wndMain = CreateWindow (MainClass, "GMAT/GRE INTRODUCTION", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, 80, 80, 650, 450, NULL, NULL, hInstance, NULL);
wndTest = CreateWindow (TestClass, "Test", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, 80, 80, 650, 450, NULL, NULL, hInstance, NULL);
ShowWindow(wndMain, SW_SHOWNORMAL);
UpdateWindow(wndMain);
Then in window wndMain's procedure, I try to show the test window I created earlier... (this is a portion of the procedure, not the whole thing)
case WM_COMMAND:
if(lParam==cmdAbout)
{
SetWindowText(txtMain,AboutPacer);
}
else if (lParam==cmdInstructions)
{
SetWindowText(txtMain,instructions);
}
else if(lParam==cmdStart)
{
ShowWindow(wndTest,SW_SHOWMAXIMIZED);
}
it says wndTest doesn't exist. This is obvously because wndTest was declared in MAIN and not procedure, but I dont know how to work this then. Any ideas?
|
|
|
|
|
declaring the variable static makes it exist only once for all instances of a class, I don't know what it achieves in a global function. I use a map of HWND to instances of my Window classes ( which I later found out MFC does too ) in order to access the varaibles associated with each Window. Apart from a similar scheme, I think you need to declare the handle globally. Just put the static HWND wndMain,wndTest; at the head of the program, and I suspect lose 'static'.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
You can trace the source code in MFC project,then you will
find the idea .
The MFC could Create more than one window.So if you look
into the source code ,you could have a entire understand
about the method.;)
|
|
|
|
|
I get this to work on Local directories, but when I try a remote machine, I get this:
11/08/01 21:28:03: Failed to start watch: The specified path is invalid. [\\DMADDEN01\Snort\Logs]
I have tried everything (that I can think of)...any ideas
Thanks in advance,
Dan
|
|
|
|
|
I have the same problem with cretedirectory, but I have no problem when I use a shared resource.
Cheers
Carlos Antollini.
|
|
|
|
|
I was always under the impression that this only worked for local drives.
Joel Lucsy (jjlucsy@concentric.net)
|
|
|
|
|
Hey Guys
Does anyone know much on the Crypto API, i just ask cos i seem to be the expert at the moment. Anyway if anyone does do you know a way of detecting the presence of a key rather then detecting the type of key.
Peter
|
|
|
|
|
Hi all!
How we change the mouse cursor to a glass hour and turn it back to normal?
There got to be an easy way to show busy and normal status right?
Thank You
Vu
vucsuf
|
|
|
|
|
If you're using MFC, use CWaitCursor. Otherwise, call SetCursor() before and after your processing.
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Hi
I just coded an app that can be minimized into systemtray.
In resource-editor I created an icon of 16x16 pixels with 256 colors.
But how I can use this icon? It is scaled down to 16 colors at runtime.
One more question:
Is there a way to send my application directly into systray with showing in on the screen when ist starts?
thanks in advance
|
|
|
|
|
in the init_instance of your program you have to call
BOOL CSetTimeApp::InitInstance()
{
...
CMyDlg dlg;
dlg.Create (IDD_MYDIALOG, NULL);
dlg.ShowWindow (SW_HIDE);
....
hope this helps... (i can't help you with the sheband with your icon)
bernhard
""Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason."
|
|
|
|
|
I have a collection of .cpp modules (some classes some just methods) that I use in my various projects. How do you orgainze these shared modules? I'm starting to get classes that depend on other classes and when I use one in a project I don't what other files I need until I get link errors. So I'm wondering how you folks oganize your shared source repositories. Keep in mind that my applications have to be as small as possible so I can't turn them into a library of some kind.
Todd Smith
|
|
|
|
|
putting functions and classes in a library doesn't really increase the size of the application that uses them. linkers are smart enough nowdays to only pull in the functions/members they need.
i put my stuff in libraries.
-c
POKE 808,234
|
|
|
|
|
I've never had a clear explanation of the advantages of putting the files in libraries, either. Seems it's done that way just because C programmers used to do it that way.
OK, it's because you can distribute the libraries and headers without source; but for internal use, where's the advantage?
|
|
|
|
|
i do it because it keeps all of my utility functions in a single project (i call mine ToolLib). it helps keep my application projects smaller (VC tends to slow down when projects get too big). i just drop all of my utils into Toollib and manage them as a subproject. and, i don't have to worry about adding each utility class file to my projects separately - include the lib project, link to it and that's it.
-c
POKE 808,234
|
|
|
|
|
Libs are good places to store 'the one you wrote earlier'.
How to group code in Libs has always been a point for argument amongst programmers (tsk, as if programmers would argue). My personal preference comes from my electronics. I would create libraries of devices. With the code controlling all aspects of that device, so that a calling function would (in many cases) have a single call in and a single status/data call.
So for example,
irq59.lib would hold all the routines tat control an irq controller.
pcdisp.lib all of the character display device code.
and so on.
In C++ I tried a few in the lines of,
dirtree.lib with the code for Directory trees
omron.lib code to control an Omron
In each case it is code that is fixed in terms of its operation and only requires control/data to work.
It is just as easy in the IDE to add a class into a project in source form. But as was said earlier you have to remember to add all the right base classes, with the libs you must have already taken care of this for your code to have compiled.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
Keep in mind that my applications have to be as small as possible so I can't turn them into a library of some kind.
You can if the library is static. In this case, the linker discards the code not used by the program.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|