|
Thanks for the hint.
By any chance, do you know what the calls are exactly? How do I get the HModule etc?
THanks.
|
|
|
|
|
Here's how:
void getAppDir
(char* szAppDir)
{
::GetModuleFileName (AfxGetInstanceHandle(), szAppDir, _MAX_PATH);
char* pPeriod = strrchr (szAppDir, '.');
if (pPeriod != NULL) {
*pPeriod = '\0';
}
} /ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
Why won't a simple GetCurrentDirectory Work
|
|
|
|
|
It will return the current directory (the one to which you've CD'd), which may not be the same as that of the app.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
I'd like to find a report component/library that has a redistributable
report designer.
In principle, Crystal Reports would be fine, except we can't redistribute
the designer, meaning our customers would have to fork out an extra £144
(~$225) to buy Crystal Reports standard themselves (no chance whatsoever -
our software is only going to cost £100-200).
So, I'm desperately trying to find a report designer we can distribute! As
long as it can put graphics and fields on a page, and we can insert data
into it, we don't need much else. Due to the short dev time of the project
I'd really prefer not to have to write a report designer in-house.
Any help very much appreciated.
Paul.
|
|
|
|
|
Paul,
I could almost write a book on this topic, I know that I have commented on this subject here before with others. Everytime I read a question like this I feel the need to vent. We ran into the same situation too, looked at the price of Crystal Reports which we have with some of our apps, but the application that I was going to be working on was going to require so many licenses that it wasn't cost effective to use Crystal anymore. We looked and played with several different components however we ended up buying Active Reports from Data Dynamics. This program allows you to import prexisting Crystal or Access report and loads of other options. Here's the kicker, it comes with a royalty free end-user designer control.
HTH
Nick Parker
|
|
|
|
|
Hi Nick,
That sounds interesting..
How well does it integrate with VC++?
Paul.
|
|
|
|
|
I know when you download the fully functional evaluation version which is available at....here Data Dynamic Downloads there are samples in many different languages, C++ being one of them. We used it for an intranet project that invloved a lot of asp and seemed to intergrate rather well. Let me know.
HTH
Nick Parker
|
|
|
|
|
I'm downloading that now, thanks.
We're also looking at Component One's (www.componentone.com) VSView Reporting Edition component and discussing the cost of royalties for distributing their designer.
If you're interested in which we end up choosing, let me know and I'll keep you informed.
Thanks again,
Paul.
|
|
|
|
|
I am, we actually looked at Component One's VSView first, however we wanted the ability to call stored procedures to return our recordset to the report and found that we were unable to do this through VSView. My boss and I called the tech support line and also sent an e-mail in to their department and all we got was a lot of red tape from some service rep who said "...the documentation I have says that it can be done, unfortunately I am not able to locate anyone here who has actually tried or confirmed that..." Without the ability to call stored procedures we felt the ability to expand with VSView was nill. Just out of curiosity let me know what you end up deciding.
Nick Parker
|
|
|
|
|
This is a C question.
I have the following for loop in my program:
for(double i=0.0; i<360.0; i+=3.0/10.0)
{
//do stuff
}
everything works fine, but I changed it to this because I need to generalize the code later on:
double angle=3.0/10.0;
for(double i=0.0; i<360.0; i+=angle)
{
//do stuff
}
and now the program crashes when I run it. I don't see the difference between either of those two. And "no" there is nothing complicated in the for loop such as changing the value of angle part way through while I'm running through the loop. So what is going on here????????
|
|
|
|
|
I tried it and didn't see any crash!
double angle=3.0/10.0;<br />
for(double i=0.0; i<360.0; i+=angle)<br />
{<br />
TRACE1("%f", i);<br />
}
Look at the reason of the error, it is an exception error?
did you pass some invalid value to a math function (most of them will
return NaN value)?
The other thing I can say, debug (F9, F10, F11).
"Dirty hands lead to important discovery..." - Thomas Edison
|
|
|
|
|
A significative difference is that in the latter case, the increment value is stored in the stack (at least in debug mode), while in the former it is a constant value directly fed to the ADD assembly instruction. So, I'd bet for your program somehow corrupting he stack (maybe writing out of bonds of some array?)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
So how do I deal with something like that?
|
|
|
|
|
To make sure, put something like this at the beginning of your for :
for(double i=0.0; i<360.0; i+=angle)
{
assert(angle==3.0/10.0);
...
} if the assert fires, then it is almost sure you're corrupting the stack. Check your indices, do a step-by-step run examining the exact moment when angle changes, etc.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi there,
I got a problem destroying a window. Just a short overview about what I'm doing:
I have a thread doing a loop and another thread showing a progress window. When the loop is done i want to send the other thread a message so that it closes (which is just working fine). My problem is that the user *could be* dragging the window right now when I Post the Quit message to UI thread and therefore the window remains open.
Any help of you guys would be appreciated very much!
Thanks,
Ruediger
It's never too early to try something really stupid.
|
|
|
|
|
Well that's because your UI thread is not processing any other message. Force processing
the other message by cancelling the "dragging" mode.
Question: when the user stops dragging the window, does the UI thread destroy it?
(it should, right?)
Hope this help you!
"Dirty hands lead to important discovery..." - Thomas Edison
|
|
|
|
|
Hi Ernest,
thanks for your reply. Unfortunately the window does NOT close after the user releases it, in fact the window is kept open and the thread stays alive for an undefined time!
Is there a way to stop the dragging mode? I suspect that the other messages are processed, otherwise the window would close after the user releases it...
Regards,
Ruediger
|
|
|
|
|
Okay, why not just destroy the window yourWindow.DestroyWindow(); ?
Sending a message with WM_DESTROY has the same effect. I suspect when you say
*dragging*, you mean the user is *moving* the window. In anyway, you should not
worry! if you need to destroy that window, just destroy it! (this is a progress
dialog, right?)
That should fix your problem.
Good luck!
"Dirty hands lead to important discovery..." - Thomas Edison
|
|
|
|
|
I tried that one too but it didn't help. The problem is that the UI thread was blocked and did not receive any messages but I found that solution now in case anybody encounters a similar problem:
in the destroy function of the calling thread I did the follwing:
DWORD dwProcessId = GetWindowThreadProcessId(m_hParentWnd,0L);
::AttachThreadInput(dwProcessId,m_pThread->m_nThreadID,TRUE);
::ReleaseCapture();
m_pThread->PostThreadMessage(WM_QUIT,0,0);
::AttachThreadInput(dwProcessId,m_pThread->m_nThreadID,FALSE);
And so it worked
Anyway, thanks for the help!!!
Regards,
Ruediger
|
|
|
|
|
Try using a 'SendMessage' instead of 'PostMessage', if you are unsure of the difference, post asynchronious and send message is synchronious....
|
|
|
|
|
I want to post a message to a window by its handle.
how can i retrieve the handle of a window?(I need this handle to post the message using the function
BOOL PostMessage(
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam );
thanks,
Aviv.
avivhal
|
|
|
|
|
GetWindow()<br />
FindWindow()<br />
FindWindowEx()<br />
GetDlgItem()
Jeremy L. Falcon
"The One Who Said, 'The One Who Said...'"
<nobr>
Homepage : Sonork = 100.16311 01000010011011110110001000100000011101110110000101110011 00100000011010000110010101110010011001010010111000000000
|
|
|
|
|
Hello,
I need to read the following two lines from a .txt file.
Name John Doe
Number +12345
Then I must extract "John Doe" and "+12345" and send them to an edit box.
I tried using strtok() but it didn't work the way I want it to. Is there a way of starting at a particular point in the string? eg in "Name John Doe" at position 6.
Thanks,
Aoife
/********************************************/
FILE *stream;
stream = fopen( "number", "r" );
char bufLine1[30], bufLine2[30];
fgets(bufLine1, 30, stream);
fgets(bufLine2, 30, stream);
char *pNext1 = ?????(bufLine1, ??);
char *pNext2 = ?????(bufLine2, ??);
strcpy(bufLine1, pNext1);
strcpy(bufLine2, pNext2);
SendDlgItemMessage(IDC_BOX1, EM_REPLACESEL, FALSE, (LPARAM)bufLine1);
SendDlgItemMessage(IDC_BOX2, EM_REPLACESEL, FALSE, (LPARAM)bufLine2);
fclose( stream );
|
|
|
|
|
Have a look at CString's Mid and Right functions.
Michael
|
|
|
|