|
|
Er....remember when I recommended that you not leave yourself so open
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
kyledunn wrote:
Tom Archer shared this answer with me so
When and where?
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
Answered in your other query for same
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
Tom Archer wrote:
Answered in your other query for same
Thanks. I saw it.
In the confuision I forgot my original reason.
You told him to use GetBuffer, but I think you didnt tell him about RelkeaseBuffer
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
Call ReleaseBuffer is not necessary in this context.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
I emailed Tom directly. He responded shortly before I posted his help here.
Kyle
|
|
|
|
|
Convert first to LPCTSTR then maybe LPSTR then to LPVOID. These are all pointers, CString isn't so you need to convert to a pointer first. The internal data structure of a cstring object is an LPCTSTR pointer; you acess it directly by calling GetBuffer(int nmax),but you also have to call ReleaseBuffer() after .
|
|
|
|
|
When i construct a query containng the query which conatins either the single quotes or double quotes then the query crashes . Can anyone suggest the solution
Samir
|
|
|
|
|
Samir Sood wrote:
When i construct a query containng the query which conatins either the single quotes or double quotes then the query crashes . Can anyone suggest the solution
For each quote you have in a string, add an extra quote.
Thus if you want to insert a string such as "John's Bakers" into a table, insert it as "John''s Bakers" and all will be well
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
But what if string contains the double quotes as part of it
|
|
|
|
|
As Nish said, you need to double up on the quotes. For example, Access chokes on quotes in a string value because it uses quotes as the string delimiter. Therefore, here's a function I wrote a few years ago to do what you need. It only handles single quotes, but obviously you can easily modify it for your needs.
CString FormatValidAccessString(CString const & sStringToBeFormatted)
{
CString sFormattedString;
int iStringLength = sStringToBeFormatted.GetLength();
char cChar;
for (int i = 0; i < iStringLength; i++)
{
cChar = sStringToBeFormatted.GetAt(i);
sFormattedString += cChar;
if ('\'' == cChar)
{
sFormattedString += cChar;
}
}
return sFormattedString;
}
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
Or to keep it really simple...
CString cMyString = "string possibly containing chars that need to be escaped...";
cMyString.Replace("'", "''");
If I remember correctly you can even get the string quotation character from ADO (the connection object probably)
so that your code is a little bit more provider independent. It's usually " for "real" databases
|
|
|
|
|
I created a combobox and put a list of data within it. Then I instantiated it and then added a selchange message.
I was trying to add a popup and some other code to the selchange but nothing I put under it ever gets executed.
I do get the new index for the item selected.
Any help would be much appriciated.
Thanks!
|
|
|
|
|
Is the OnSelChange function being executed or does it not get called. If the function is being called, can you post what code you are expecting to execute.
Is the OnSelChange function in the dialog class?
Michael
Communication is the first step towards enlightenment.
|
|
|
|
|
Well I went and deleted the combobox sechange and started over.
Now it seems like it is executing but the index isn't getting set. HMMM
|
|
|
|
|
How to set EditBox as readonly and steel have a white backgroud ?
any ideas ?
|
|
|
|
|
While I disagree with your UI decision (it definitely goes against what users are accustomed to), you can do this by handling the OnCtlColor message. There's a few threads here about how to do that. Just search on that function name and you should find what you need.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
I believe the reference you will find helpful is by Chris Losinger, Colorizing Edit Control at CodeProject.com
This may or may not be exactly the one, but I have a ZIP that I downloaded named "ColorEdit_ColorStatic".
It tells how to change colors of foreground text and background for both edit controls and static controls (e.g. labels.)
Good luck. These helped me bring my dialogs to life!
Johnny
|
|
|
|
|
anybody have any sample c/c++/asm code to read sectors from a cd, or know where i can find an example ?
|
|
|
|
|
Try loading wnaspi32.dll and use that to send commands to the cd-rom. Or just look up documentation on the ASPI layer.
No School
No Job
No Problem
|
|
|
|
|
Hey everybody.
You know how in Windows Display Properties Appearance you can change the colors and fonts for many system items like menus, 3DObjects, etc. You can obtain the color settings using GetSysColor(), but I was just wondering if anybody out there knew how to obtain the font settings for the items? Particularly the Message Box.
I've searched through Code Project and MS Knowledge Base but didn't find anything (probably not using the right keywords or something).
Anyone?
Thanks
|
|
|
|
|
In MFC you shoul dbe able to get a handle to some fonts by using the AUX_DATA structure afxData . It has some fonts in it as HFONT objects. Nit sure if they are the ones you need.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
I'd prefer a non-mfc approach (sdk). The only 2 fonts I find in that AUX_DATA structure are StatusFont and ToolTipsFont (at least in the version I have).
|
|
|
|
|
Try
SystemParametersInfo( )
Maxwell Chen
No code is good code.
|
|
|
|