|
Not 100% sure as it's 2 years since I wrote GDI wrappers but I think SetDCBrushColor is that wierd API that is documented everywhere but doesn't exist/work anywhere, at least pre-Vista. I'm sure Google will confirm or deny this pretty quickly, it's worth a check. If memory serves there is an alternative possibly Ex variant which works at least in XP.
DC_BRUSH is defined in WinGDI.h iff _WIN32_WINNT >= 0x0500 so you need to be building for Windows 2000 or later to use it and linking to gdi32.lib of course.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Will this help????
<br />
CBrush brush;<br />
brush.CreateSolidBrush(RGB(230,251,251));<br />
<br />
CBrush* pOldBrush1 =pDC->SelectObject(&brush);<br />
<br />
pDC->SelectObject(pOldBrush);<br />
Priya Sundar
|
|
|
|
|
Hi,
I want to check if a table exists in sqlite,sql server 2005,mysql and in sqlexpress databases. if the table doesnt exist i have to create table in all these databases.i tried create table[if not exists] command but it is working in sqlite but not in sql 2005.
can anybody plz help me out...
kk
|
|
|
|
|
santhi_malli wrote: if the table doesnt exist i have to create table in all these databases.i tried create table[if not exists] command but it is working in sqlite but not in sql 2005.
whta is the code! have track the error, which is throwed!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I want to write c++ program that converts distance entered in metre (input) to be converted to feet and inches and vice versa the program should use classes. Anyone to help me out???pliz
tick tock tick tock programming tick tocks...
|
|
|
|
|
what have you tried so far, and where are you stuck with the code ?
this looks like a homework, and if you don't try by yourself, how will you learn things ?
|
|
|
|
|
concomarx wrote: I want to write c++ program that converts distance entered in metre (input) to be converted to feet and inches and vice versa the program should use classes
The big deal, my dear, is to fit all the above calculations in few classes...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I've tried it gives me funny errors, hows that got another way maybe am doing it badly
tick tock tick tock programming tick tocks...
|
|
|
|
|
Try to post your code..
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
concomarx wrote: I've tried it gives me funny errors...
Errors aren't funny, they are serious.
concomarx wrote: ...maybe am doing it badly
How could we possibly know if you don't show us what you've tried?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
1 meter = 39,370079 inch = 3,28084 foot
1 inch = 0,083333 foot = 0,0254 meter
1 foot = 0,3048 meter = 12 inches
Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
concomarx wrote: tick tock tick tock programming tick tocks...
MATLAB-Programmer?
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
jhwurmbach wrote: MATLAB-Programmer?
humm c++ programmer
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
tick and tock are the timing functions in MATLAB-script.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
tick and tock are the timing functions in MATLAB-script.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Here is the declaration statement.
unsigned char *String;
Now i have made String point to "{abcdef}".
Here i need to delete the paranthesis, i.e, i need to delete the first and last character in 'String'.
How to make it point to a val of just "abcdef" without the first and last character??
Kindly help!
Priya Sundar
|
|
|
|
|
are you using MFC?
i.e. CString
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
chandu004 wrote: are you using MFC?
the OP specified explicitely that he was using a unsigned char *String .
so 1) read the questions
and 2) before giving advices to the forum members, stick to the rules yourself
|
|
|
|
|
so 1) read the questions
and 2) before giving advices to the forum members, stick to the rules yourself
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
Thanks for your concern.
Yes i use MFC.
By your question, I got an idea to convert it into a CString and apply delete and then save it back - something like this;
<br />
unsigned char *String;<br />
<br />
CString cString,result;<br />
cString="{abcdef}";<br />
int n=cString.GetLength();<br />
result=cString.Mid(1,n-2);<br />
<br />
String = (BSTR)rest; <br />
However, here i am not able to store it back to 'String'. i am getting various compiler errors like
" error C2440: 'type cast' : cannot convert from 'class CString' to 'unsigned short *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called "
Need help in typecasting in the last line.
Priya Sundar
|
|
|
|
|
What is rest , and why are you trying to cast it into a BSTR , when what you wand is a unsigned char* ?
And why unsigned char ? Thats uncommon.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
|
You want to convert a GUID to a String?
Try somthing like this:
void GetFormattedGuid( const GUID& guid, CString& rString)
{
const CString strFormat(_T("%08lX-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X"));
rString.Format(strFormat,
guid.Data1, guid.Data2, guid.Data3,
guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
guid.Data4[4], guid.Data4[5], guid.Data4[6], m_guid.Data4[7],
);
} When you are using MFC anyway, there is no point in not using it to help you.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Sorry, i want to convert a character array to GUID
<br />
bool CTcpIpPropertiesChangerApp::UUidConversion()<br />
{<br />
char szValue[MAX_GUID_STRING_LEN];<br />
<br />
szValue={A89377EA-D4ED-4A03-A37F-4A9DE785E1A9};
<br />
unsigned char *GuidString=new unsigned char[MAX_GUID_STRING_LEN];<br />
GuidString[MAX_GUID_STRING_LEN - 2] = _T('\0');<br />
<br />
for(int l=0;l<MAX_GUID_STRING_LEN;l++)<br />
GuidString[l] = szValue[l];<br />
<br />
GUID ret = { 0 };
if(UuidFromString(GuidString,&ret)==RPC_S_OK)<br />
{<br />
delete GuidString;<br />
return true;<br />
}<br />
else<br />
return false;<br />
}<br />
Now this function is always returning false as UuidFromString is always returning RPC_S_INVALID_STRING_UUID telling that the string UUID/GUID 'GuidString' is invalid.
Priya Sundar
|
|
|
|
|
Priya_Sundar wrote: Now this function is always returning false as UuidFromString is always returning RPC_S_INVALID_STRING_UUID telling that the string UUID/GUID 'GuidString' is invalid.
Wow.
This is the first time you give a proper error report.
You never mentioned this function before.
OK. For me
#include "stdafx.h"
#include <atlstr.h>
#include <iostream>
#include <RPC.h>
#pragma comment( lib, "Rpcrt4")
int _tmain(int argc, _TCHAR* argv[])
{
const char szValue[] = "{A89377EA-D4ED-4A03-A37F-4A9DE785E1A9}";
CString szGuidString( szValue+1, strlen(szValue)-2);
GUID ret = { 0 };
const RPC_STATUS status = UuidFromString( (unsigned char*)(LPCTSTR)szGuidString, &ret);
if( status == RPC_S_OK)
{
...
}
else
{
...
}
return system("pause");
} worked.
Note the double cast in the UuidFromString-call: It is used to get the raw const TCHAR* from the CString , and the other cast tells the compiler "Shut up and take this as if it were unsigned s!".
That is not Unicode-compatible. Under Unicode, the CString would hold wchar_t s, and by forcing the compiler to tread them as a string of unsigned char s, anything could happen.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|