|
Thanks jhwurmbach for your advise,
I actually need to pass a hint actually, on which propretypages need to reload them with the data.
Thanks again for the adivse.
|
|
|
|
|
Hi y'all! Can anyone tell me how to create an EditWordBreakProc function for Word Wrap
option in Win32 application ?
|
|
|
|
|
Hello,
I have 2 status bars in my SDI app.. The second status bar is only displayed when specific functions are ran and it's displayed right above the standard status bar at the bottom.. is there a way I can take the gripper off of the top status bar.. it looks really bad having 2 grippers.. I have tried to ~SBARS_SIZEGRIP on the bar style but it doesn't work.
Any ideas?
Rob
|
|
|
|
|
You have to derive a new class and set the ~SBARS_SIZEGRIP in its precreatewindow().
Search MSDN and you will find it. It is a bug.
Hari Krishnan
|
|
|
|
|
0 errors, 0 warnings.
why?! why?! why!! ! ! !
anyone want to get email and try to help me solve this?? I got an evil mysterious bug.
Ive tried 3 seperate file handling libraries , I dont even think its a file handling problem anymore. compiles and links fine, but its getting a microsoft send / dont send error dialog and crashing.
argh!!!
|
|
|
|
|
jDawwg wrote:
0 errors, 0 warnings.
This says that there are NO compilation and link errors or warnings, it does not say that your application is without bugs and defects!
Can you tell us more ? What you are doing, where it crashes ( have you run it in a debugger ? started with the F5 key )
Max.
|
|
|
|
|
jDawwg wrote:
0 errors, 0 warnings.
why?! why?! why!! ! ! !
Your code has no syntax errors.
Why it crashes is impossible to tell when you don't post the your code that crashes!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
sorry
heres the code
......
int len;
int result;
char c2[255];
char c3[]="\0";
char c4[]="";
<br>
AfxMessageBox("Starting The Bouncer!");
<br>
HENV hEnv = NULL;
HDBC hDBC = NULL;
HSTMT hStmt = NULL;
UCHAR szDSN[SQL_MAX_DSN_LENGTH] = "cplusmysql";
UCHAR szUID[10] = "xxxx";
UCHAR szPasswd[10] = "xxxx";
UCHAR szModel[128];
SDWORD cbModel;
RETCODE retcode;
<br>
SQLAllocEnv (&hEnv);
SQLAllocConnect (hEnv, &hDBC);
<br>
retcode = SQLConnect (hDBC, szDSN, SQL_NTS, szUID, SQL_NTS, szPasswd, SQL_NTS);
<br><br>
BOOL freeResult, runTimeLinkSuccess = FALSE;
HINSTANCE dllHandle = NULL;
BounceCheckType BounceCheckPtr = NULL;
dllHandle = LoadLibrary("bBounce.dll");
<br>
BounceCheckPtr = (BounceCheckType)GetProcAddress(dllHandle,"BBBOUNCECHECK");
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
{
CFileInfoArray fia;
fia.AddDir(
m_spoolpath,
"*.*",
TRUE,
CFileInfoArray::AP_SORTBYNAME | CFileInfoArray::AP_SORTASCENDING,
FALSE
);
for (int ji=0;ji<fia.GetSize();ji++) {
ifstream is;
is.open (fia[ji].GetFilePath(), ios::binary );
is.seekg (0, ios::end);
int length = is.tellg();
is.seekg (0, ios::beg);
char * c1 = new char [length+1];
is.read (c1,length);
is.close();
c1[length+1] = '\0';
if(NULL != dllHandle)
{
if (runTimeLinkSuccess = (NULL != BounceCheckPtr))
{
result = BounceCheckPtr(*c1, *c2, len, *c3, *c4);
}
}
UCHAR szSqlStr[128];
if (result == 1) {
sprintf((char*)szSqlStr,"INSERT into bouncetest Values ('HB', '%s')",c2);
SQLAllocStmt (hDBC, &hStmt);
SQLPrepare (hStmt, szSqlStr, sizeof (szSqlStr));
SQLExecute (hStmt);
SQLBindCol (hStmt, 1, SQL_C_CHAR, szModel, sizeof(szModel), &cbModel);
SQLFetch (hStmt);
SQLFreeStmt (hStmt, SQL_DROP);
}
delete[] c1;
}
freeResult = FreeLibrary(dllHandle);
}
SQLDisconnect (hDBC);
SQLFreeConnect (hDBC);
SQLFreeEnv (hEnv);
AfxMessageBox("Finished Sorting Bounces");
|
|
|
|
|
...
char * c1 = new char [length+1];
is.read (c1,length);
is.close();
c1[length+1] = '\0';
... The last line should be
c1[length] = '\0'; This is the first thing I've noticed on a quick review, maybe some more errors are still lurking in the code.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
changed that to what you suggested, still crashes.
|
|
|
|
|
If you could put a breakpoint in at the start of the function, and then Step through the code to find out where the program bombs it would be a lot of help for us to be able to find the bug.
|
|
|
|
|
did that,
it dies at
delete[] c1;
also, i will send anyone who needs a better look the project files if you need them.
|
|
|
|
|
sprintf((char*)szSqlStr,"INSERT into bouncetest Values ('HB', '%s')",c2); c2 is not initialized to anything, this is faulty. Moreover, szSqlStr is not given space enough to accomodate the maximum string possible, approx. equal to 255 plus some 50 chars.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
c2 is initialized. at the beginning , it is initialized to contain nothing. its just storage space for the API to write into.
at the point you are referencing to in my code, c2 contains a value that was given to it via the API function.
thanks for the suggestion , although it is not the problem. Also, szSqlStr has enough space for my needs, why do you suggest it to be bigger?
|
|
|
|
|
c2 is initialized. at the beginning , it is initialized to contain nothing. its just storage space for the API to write into.
By "the API" you mean that pointed to by BounceCheckPtr ? What does this API do? Also, have you checked BounceCheckPtr is not null?
Also, szSqlStr has enough space for my needs, why do you suggest it to be bigger?
Well, c2 is 255 chars: without further info, seems reasonable that, under some ocassions, the strings stored in it can get near that maximum size, wich will overflow a 128 chars szSqlStr .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín M López Muñoz wrote:
c2 is initialized. at the beginning , it is initialized to contain nothing. its just storage space for the API to write into.
By "the API" you mean that pointed to by BounceCheckPtr? What does this API do? Also, have you checked BounceCheckPtr is not null?
Yes, and its not null..The API determines status of a file. Im passing the contents of the file to the API via C1.
The API writes a string to c2 and returns a value as the status code of the kind of file it analyzed.
Also, szSqlStr has enough space for my needs, why do you suggest it to be bigger?
Well, c2 is 255 chars: without further info, seems reasonable that, under some ocassions, the strings stored in it can get near that maximum size, wich will overflow a 128 chars szSqlStr.
oh , ok... i see what you mean now, but i know that the c2 is only going to be between 10 - 30 charactors. really i guess i could clean it up a bit since i dont need the extra space, but i wasnt really worried about it... i was trying to figure out the mystery bug.
just to be sure tho, now that i see what you meant i tried setting szSqlStr to 400 ,still compiles 0 errors, 0 warnings, but im also still getting the mystery bug.
also since i know its the next logical concern, its also definetly not the API. The same .dll file for the API is working perfectly with a program i developed w/ VB.
|
|
|
|
|
Im passing the contents of the file to the API via C1.
Given the expression
BounceCheckPtr(*c1, *c2, len, *c3, *c4); seems what you're passing is not c1 , but rather the character c1[0] , unless the function accepts char& s or something like that. Is that the case? If not, could it be you meant to write this?
BounceCheckPtr(c1, c2, len, c3, c4); (Excuse me if I'm saying nonsense.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You mentioned in one of your threads that it crashes on the line delete []c1.
If that is so then can you see through your debugger what is in c1 at the time of the delete?
Also, between
char * c1 = new char [length+1]; and the delete the only place c1 is used seems to be
result = BounceCheckPtr(*c1, *c2, len, *c3, *c4);
So comment this line out and then see if it crashes at delete[] c1.
If not then it is most like the BounceCheckPtr which is screwing up on the memory. It may be deleting what is c1 before you can delete c1.
|
|
|
|
|
Would anyone know how to write to a .rtf file (rich text), as well as change the color/face of written text, etc... I'm looking to make a log file with some different colors and fonts. Thanks!
|
|
|
|
|
You want to know RTF?
If so, I may have a suggestion for you. Create a Word document that will look like the log files you want to have. Then save the document in RTF and open the file in text mode and see the RTF formatting.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
You can find the RTF 1.6 specification here[^]. It's very easy to follow and you should not have any difficulty. If you want to see how an RTF document looks like, write one in Wordpad (not Word, the RTF it generates is too bloated), and then open it in notepad to see how it looks like. Then if you read it side by side with the RTF spec, you will find it much easier to follow.
Regards,
Rohit Sinha
|
|
|
|
|
... COM threading models? (apartment, free, single, multi, both)
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Read the following:
http://www.codeguru.com/activex/COMApartments1.html
http://www.codeguru.com/activex/COMApartments2.html
|
|
|
|
|
Tx for the pointers
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I am developing and application in VisualC++ 6.0 and I want the interface to
be in Greek.
I have created all the items of the interface (doalogs menus etc) in Greek
and the application works fine.
However all the Windows dialogs (such as the Open file dialog) appear in
English.
Does anybody knows how could I make these dialogs to appear in Greek ?
(Without having to code them from scratch)
Thanks
Dionysis photeinos@lfme.chemeng.upatras.gr
|
|
|
|
|