|
How to disable a control(let's say combo)?
|
|
|
|
|
In MFC:
combo1.EnableWindow(FALSE);
from memory the Windows API is something like:
EnableWindow(hCombo, FALSE); //hCombo is a window handle
hope this helps.
Matt
------
Accept that some days you are the pigeon and some days the statue.
|
|
|
|
|
Has anyone been able to use the Xalan.transform call. I have been going around in circles for a couple of days and getting nowhere.
The supplied sample uses an ostrstream variable for the third argument and that will not compile for me. When I convert the third argument to an XSLTResultTarget (various attempts) if compiles but then crashes in the function. Any guidance is very much appreciated.
// Begin My Code which compiles but crashes on the .transform call
// Call the static initializer for Xerces.
XMLPlatformUtils::Initialize();
// Initialize Xalan.
XalanTransformer::initialize();
// Create a XalanTransformer.
XalanTransformer theXalanTransformer;
CString theXMLFileName = "MyTest.xml";
CString theXSLFileName = "MyText.xsl";
XalanDOMString theOutput;
XSLTResultTarget theTarget(theOutput);
// Do the transform.
int theResult = 0;
theResult = theXalanTransformer.transform((LPCSTR)theXMLFileName, (LPCSTR)theXSLFileName, theTarget);
// Terminate Xalan.
XalanTransformer::terminate();
// Call the static terminator for Xerces.
XMLPlatformUtils::Terminate();
// End My Code
//Sample code – which will not compile
ostrstream theOutput;
// Do the transform.
theResult = theXalanTransformer.transform(theXMLFileName, theXSLFileName, theOutput);
// End Sample Code
|
|
|
|
|
Just to document the initial problem.
The error was the version that would not compile was not using the same include for the declaration of ostrstream that the Xalan build had used. Rebuilding the entire set (Xerces, Xalan, and my sample) fixed that problem.
Now however I find that the Xalan code will only work for me in a console application. The same code copied into a function in a Dialog application always returns an error (can not parse XML file). The file is the same one processes in the console app.
If any one has any samples of using the Xalan transformation code in a windows app I woud appreciate seeing it.
Thanks Mike
Michael A Barnhart
mabtech@swbell.net
|
|
|
|
|
Here's a test for all you C/C++ programmers: anything strange in the following code fragment? (Try not to compile it, okay? Just see if you can spot anything strange!)
char ch;
for (ch = 0;ch <= 255;ch++)
std::cout << ch;
|
|
|
|
|
There is no opening and closing brackets for the cout instruction?
This works with the microsoft compiler but not with C++ Builder.
(Am I wrong? - I really didn't cheat)
|
|
|
|
|
oops, wrong answer, Frederick! See the other posts!
|
|
|
|
|
Besides the first 31 characters containing control and unprintable characters, I would say the problem would be that 255 would never be reached. char can contain values -128 through to 127. As soon as the eighth bit was filled it would become a negative number.
So how did I go?
Am I as good as I tell my wife I am or what !!!
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Even with unsigned char, you would have trouble because the loop condition is for i <= 255, so even an unsigned char would roll over to 0 without terminating the loop.
|
|
|
|
|
Not true. unsigned char can hold a value of 255. Formula is 2n -1 (where n is the number of bits in the data type)for unsigned values. In this case it is 28 - 1 = 255.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Of course unsigned char can hold 255, but to terminate this loop you need 256, look again on condition:
ch<=255;
Do you feel that you still good?
|
|
|
|
|
Bingo! I'd say your wife is lucky. On the other hand, you could be a nerd...
|
|
|
|
|
Dear All
How efficient is this editor to build a customized setup file making use of the windows installer.
regards
Sankar
|
|
|
|
|
Orca is not the tool to use for creating Windows Installer packages. You need something like Installshiled or Wise. Orca can be used to view and modify an existing package though.
|
|
|
|
|
Has anyone figured out how Microsoft (MFC) gets away with storing a pointer to a function with the thiscall calling convention (meaning it pushes an implicit this before its normal parameters)?
|
|
|
|
|
There's nothing magical about it, if I understand your question. When you call the function thru the function pointer, you still need an object to provide the this pointer.
CWnd wnd = ....;
BOOL (CWnd::*pFunc)(int) = CWnd::ShowWindow;
(wnd.*pFunc)( SW_SHOW ); In that example, wnd provides this .
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
That did the trick. It makes sense too...I was just under the impression you couldn't declare a function pointer with the CWnd:: attached to it. Probably remnants of someone telling me "Oh you want to do what?? you cant do that!" Thanks a bunch
|
|
|
|
|
Got two questions regarding wizard/CPropertySheetx:
1. is there a way to hide Help button?
2. how to make the watermark stayed at left
side of the dialog box instead of filling the
entire area? thanks.
p.c.
|
|
|
|
|
Yes, I think the ID of the button is IDHELP, or something similar. So GetDlgItem, and call ShowWindow(SW_HIDE).
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
In the PROPSHEETHEADER, remove PSH_HASHELP from the dwFlags member. Then in each PROPSHEETPAGE, remove PSP_HASHELP from dwFlags. Those flags are turned on by default in MFC wizards.
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
Does anybody have a class to convert a string e.g "1230" to readable format e.g. "thousand two hundred thirty" .
Or is there an API for this ?
Orcun Colak
orcuncolak@yahoo.com
|
|
|
|
|
This is a common homework question so I'm sure there are answers on the web ( assuming you don't need it for homework, if you do, then I'd suggest doing your own homework is a good way to leave Uni with knowledge as well as a certificate and surviving in the job market ).
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
No it is not homework. maybe it is my fault that i did not explain it very good.
I am searching something like this because i was wondering what other approaches are taken by other people. I want to have a generic class that i can use for many different languages besides english. Not every language has the same "conversion logic" For example "1000" which is "one thousand" is only "thousand" without one in some languages or "11" which is "eleven" is "ten one" is some languages. i am not sure if i could explain it ??
i was in search of something which can be converted to another language easily covering all the exceptions. am i asking too much ? anyway thanks for your response.
|
|
|
|
|
How do I set the color (background) for a dialog. I tried SetDialogBkColor, and it didn't have any effect.
Richard
|
|
|
|
|
Handle WM_ERASEBKGND and fill in the client area with whatever color you want.
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|