|
When I use:
"[MyField] ='"+sMyString+"'"
everything works fine unless there is a a single quote in sMyString. Then I get a JET error that a parameter is missing.
Any ideas?
Richard
|
|
|
|
|
I have an icon I am displaying, its a simple check. I need to display it in a few different spots simultaneously. Is there a way to do this without creating a spereate variable for each check, and using ShowWidow()?
|
|
|
|
|
Where are you using the icon? You mentioned ShowWindow() so I'm guessing your using it in a window... do you need to diplay it more than once in a window, or are you wanting to diplay it in multiple windows?
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
I could have created a bitmap file as well, either would have worked. I need to show it multiple times from a single dialog window. Anywhere from 1 to 7 times. Right now I have...
enum { IDD = IDD_PROGRESS_DLG };
CStatic m_ctrlCheck1;
CStatic m_ctrlCheck2;
CStatic m_ctrlCheck3;
CStatic m_ctrlCheck4;
CStatic m_ctrlCheck5;
CStatic m_ctrlCheck6;
CStatic m_ctrlCheck7;
I would think this is a waste, since 90% of the time i will only show 3 or 4. My guess is that there is a way to create/show them without creating a variable for each possibility.
|
|
|
|
|
Its sounds like you to me like your making one of those nifty progress dialogs that puts checkmarks beside the tasks that have been completed. Have you considered making an owner-drawn static control that can display the checkmark and the task's text? You could then just create the number of them you need dynamically -- and just store their pointers a list.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Hello!
Is there any way to use a std::string with the Windows API method LoadString() without having to use a char* as an intermediate step? For example, something like this:
std::string junk;
LoadString(AfxGetInstanceHandle(),IDS_JUNK_STRING,junk.c_str(),250);
This doesn't compile, but maybe there's a way around it. I'm just not used to mixing STL and C-API's.
Thanks,
Derek
|
|
|
|
|
Yes you can.
const int MAX = 250;
std::string junk;
junk.resize(MAX);
LoadString(AfxGetInstanceHandle(), IDS_JUNK_STRING, &junk[0], MAX);
Jam on.
|
|
|
|
|
Thanks! It works using a std::vector<char>, but I wasn't sure if it was correct to use the same &junk[0] method for std::string.
|
|
|
|
|
Yep, vector and string are the two STL containers with guaranteed contiguous memory.
|
|
|
|
|
Actually, Neither string or vector guarantee contiguous memory today. There is a proposal in front of the committee to alter the standard to require contiguous memory for vector, but not for string.
Having said that, it's highly unlikely that anyone will create a string implementation that doesn't use contiguous memory, at least on Win32.
|
|
|
|
|
I'm writing a MDI application with a toolbar in a child window. I want to chnge the toolbar from flat to non-flat buttons (and back) programatically.
I've already got a function in the CChildFrame class that responds to an message, but everything I try results in failure (in one form or another).
Does anyone know what the secret is?
|
|
|
|
|
Hi John,
I just tried with ModifyStyle(TBSTYLE_FLAT, 0) (and vice-versa) and Invalidate() and it seems to work. It's a very simple project though ...
From where are you trying to change the toolbar? (I did it in the MDI child frame)
Well, I think we all need more details to help
Paolo.
|
|
|
|
|
That was exactly what I needed. Thanks buddy.
I was over-engineering my own attempt at a solution, and was so far into the forest, I couldn't see the trees.
|
|
|
|
|
I can't figure out how to control the color of text drawn with CDC::TextOut. CFont or LOGFONT don't seem to have a color attribute, and none of the other crazy things I tried worked. Ideas?
thanks,
Jake
|
|
|
|
|
CDC::SetTextColor(clr);
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
|
|
A long is 32bits.
so try 2^31 for a long (1 bit for sign) and 2^32 for an unsigned long
+-2147483648 and 4294967296
there are defined for these. Look for MAX_LONG, MAX_FLOAT etc.
|
|
|
|
|
from -2147483648 to 2147483648.
The LONG is a 32-bit signed integer!!!
Cheers!!!
Carlos Antollini.
|
|
|
|
|
What this 'xor'?
How do use in this in vc++
|
|
|
|
|
True xor True => False
True xor False => True
False xor True => True
False xor False => False
For use it you need to use the ^ macro.
^ == Xor
Cheers
Carlos Antollini.
|
|
|
|
|
so:
^x;
or so:
x^;
or another ?
|
|
|
|
|
XOR is a binary operator.
z = x ^ y;
if x = 00101101b
and y = 01110111b
then z = 01011010b
Hope this helps.
>>>-----> MikeO
|
|
|
|
|
|
CSrting str;
I want that str would contain some variables in its string
for example so:
str = (" the price is %d, the nameis: %s", x,s);
|
|
|
|