|
Bravoone_2006 wrote: but is nobody who can explain me things !
Honnestly, no. The problem comes from the fact that you seem to lack even the basis of C++ concepts. So, a lot of people tried to help you already but it is impossible to make you understand some simple concepts without going first through the basis. If you REALLY want to learn, you should stop what you are doing now (way to complicated) and search for a book or a tutorial on the web that will start from the begining. You don't even seem to grasp the concept of classes, which is highly needed for the things you are trying to do. You should learn how to walk before trying to run.
|
|
|
|
|
You couldn't have summed it up any better!
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
But he still doesn't seem to understand: [^]
I'm giving up
|
|
|
|
|
Reminds me of my three-year old. While you're giving him the answer, he's asking the question (again).
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
if you are new to c++ i think its hard for you to write a database program
|
|
|
|
|
i have this massage you know what is this ? and what i must do ?
local variable 'm_Bun' used without having been initialized
i have this :
class CMyClass
{
private:
int m_Bun;
}
Bravoone
|
|
|
|
|
It is a warning that says that you use this variable without setting a value to it. You should always initialize your member variables in the constructor of your class.
|
|
|
|
|
if i dont specify that when i write something in CEdit my program is cloasing ! WHY ???????
CDatabase_Bun *m_prs = new CDatabase_Bun;
----->>>>>>>> new <<<<<<<<<<<-------
Bravoone
|
|
|
|
|
Bravoone_2006 wrote: local variable 'm_Bun' used without having been initialized
C4700
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
if you dont need to int m_Bun; you can delete it from your program
|
|
|
|
|
How can i remove spaces in my database ?
my database : visualfoxpro 6.0
CDatabase_Name::CRecordset
(MFC)
col1 = "name"
col2 = "city"
col3 = "country"
tank you in advance !
Bravoone
|
|
|
|
|
It seems this question is for sql forum
|
|
|
|
|
Bravoone_2006 wrote: How can i remove spaces in my database ?
You asked the same question
Here
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I guess i saw this question previous
|
|
|
|
|
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
You really must STOP reposting every one of your questions. If you didn't get an answer the first time, then it's doubtfull you will get one the second.
|
|
|
|
|
Bravoone_2006 wrote: How can i remove spaces in my database ?
Asking the same question on two consecutive days is not going to get you a different answer. Are you just plain incapable of heeding suggestions? Folks here have gone way out of their way to help you and you've not so much as lifted a finger to apply anything. That's called lazy and selfish!
Bravoone_2006 wrote: tank you in advance !
Tank is a slang verb that means to fail. Hopefully this is not your mantra.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello!Does anyone know if you can monitor a printer and count the number of print jobs in the queue?Say if there is more than 10 documents/jobs then i need to stop the Print service. (Use VC)
thanks
From Neusoft
|
|
|
|
|
hsdok wrote: Does anyone know if you can monitor a printer and count the number of print jobs...
What's wrong with EnumJobs() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello Everyone, I am here again with a UNICODE Question. I hope this is the last one . I am trying to create a tstring from a char[]. From the debugger the contents of the string looks correct but when I try to use it in an DirectX api call it compiles and runs but does not function correctly. I have seen this error before and it was down to using ASCII instead of UNICODE and I solved it by defining UNICODE and using _T() either when creating a string or harding coding a api call param. But this does not work with a char[]. Here is my code:
#ifdef UNICODE<br />
typedef wstring tstring;<br />
#else<br />
typedef string tstring;<br />
#endif<br />
<br />
char szFile[350];<br />
ofn.lpstrFile = (LPWSTR)szFile;<br />
tstring fileName (ofn.lpstrFile);<br />
D3DXGetImageInfoFromFile(fileName.c_str(), &Info);<br />
<br />
I have only put in the code that directly relates to what I think is the problem for clarity sake. The code works if I replace fileName.c_str() with _T("actual file path") which is why I think the problem is with how I have encoding the string. Is the problem with (LPWSTR)? I did not think so as I was only getting it to point to the array. Any help is really appreciated.
|
|
|
|
|
BarryOg wrote: #ifdef UNICODE
typedef wstring tstring;
#else
typedef string tstring;
#endif
Shouldn't this be...
#ifdef _UNICODE
typedef wstring tstring;
#else
typedef string tstring;
#endif
BarryOg wrote: char szFile[350];
//create a file dialog info struct and fill it up as required than point it too our char buffer
ofn.lpstrFile = (LPWSTR)szFile;
You are asking for trouble...
Instead do this...
TCHAR szFileBuffer[MAX_PATH];
ofn.lpstrFile = szFileBuffer;
|
|
|
|
|
To properly convert, you can use the MultiByteToWideChar() function, and to go the other way, you can use WideCharToMultiByte(). These will convert between ANSI/MBCS and UNICODE and vice versa.
You can use casts as much as you like to convince the compiler, but the data stays the same.
WCHAR buf[_MAX_PATH];
#if !defined(UNICODE)
int n = MultiByteToWideChar(CP_ACP, 0,
filename.c_str(), filename.length(),
buf, _MAX_PATH);
if (n>=0)
{
buf[n] = L'\0';
}
#else
wcscpy(buf, filename.c_str());
#endif
D3DXGetImageInfoFromFile(buf, &Info);
Steve S
Developer for hire
|
|
|
|
|
Thanks for the replies, neither of the solutions seem to fix my problem, I'm going to go read about character encoding in detail and figure out exactly what I'm doing wrong instead of just bashing around and than asking for help.
|
|
|
|
|
Looking again at your example, you have #ifdef UNICODE to type the std::string you want, but then later on you use a char buffer and an explicit cast.
You could use a TCHAR buffer (and no cast), which would give you whatever the compile flags say you're using (UNICODE/wchar ANSI/char). That way you may not need to do conversions at all in many cases, or use conditional conversion for different builds.
Don't despair.
Getting to grips with UNICODE when all you've done before used simple char[] stuff takes time.
Use the debugger to examine memory (not just display strings) so that you can see whether what you have in various places is what you think you should have.
Steve S
Developer for hire
|
|
|
|
|
Thanks for the encouragement , I've been busy last few days but hopefully will give this a shot tonight.
|
|
|
|