|
It seems a project in VC6.0 whats problem with compile this project
|
|
|
|
|
Sir,How Can Find or See WinMain Function in Simple MFC Application ?Pls help in understanding concept better.
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
Can you be more specific what do you need?
|
|
|
|
|
Hi fellows. I've got to do an animation. I have 18 bitmaps and I have to animate them, simply, one after another one. I use a timer that calls InvalidateRect(NULL, FALSE) so that the window gets repainted (I do all the calculations in OnPaint to determine which is the next image of the sequence to be shown).
However, this is causing my window to flicker... How do I do to avoid such annoying problem?
Any help will be really appreciated. Thanks in advance.
Regards,
Fernando.
A polar bear is a bear whose coordinates has been changed in terms of sine and cosine.
|
|
|
|
|
First, when you call InvalidateRect(), don't pass NULL. Calculate the correct rect of the bitmap and pass that.
Second, when you call InvalidateRect(), don't pass FALSE. You don't need to erase the background, this only causes the region to be painted twice.
Third, Use double buffering. Do all your drawing off screen then draw everything back to the screen in one go.
|
|
|
|
|
You can also use from a avi file in your program with create your graphic files into a avi file
|
|
|
|
|
Thanks, I thought so at first, however, MFC for CE does not support CAnimationCtrl... Indeed, I solved the problem by creating a CWnd-derived window, and I placed the animation in there. Since it's a window in its own, it does not flicker at all.
Regards,
Fernando.
A polar bear is a bear whose coordinates has been changed in terms of sine and cosine.
|
|
|
|
|
I have added the options Enable Profiling and Generate Mapfile to the link options of the resp projects I would like to profile and rebuilt the proj. But still I do not have the profile menu item in my build menu activated. cud someone point me out where I am going wrong?
Also what is the procedure to enable profiling in VS9.0, cud someone provide me the step-wise procedure?
Thanks and in anticipation of an early reply.
|
|
|
|
|
Hi,
We know some TWAIN SDK in VS C++???
I need it... Or some samples for the TWAIN?
Thanks
|
|
|
|
|
|
But I need something for commercial purposes...
|
|
|
|
|
|
Hi all,
Im trying the following, I have a character pointer and a char array, I'm trying to assing the value of the pointer to the array, with no luck, please help??
char* variable = "what ever";
functionExample(variable);
void functionExample(char* variable)
{
char Value[] = variable;
}
Thanx in advance ....
Only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: char Value[] = variable;
that is not legal C++.
the easiest way to do this is with a string class of some kind:
CString Value = variable;
or
std::string Value = variable;
or, if you have to use a char array:
int iLen = strlen(variable);
char Value = new char [ iLen + 1 ];
strcpy(Value, variable);
Value[iLen] = 0;
...
delete [] Value;
|
|
|
|
|
|
CString is not the STL std::string class. it comes from MFC.
|
|
|
|
|
|
couldn't you just search the MSDN[^] ... ?
|
|
|
|
|
|
hello! All
i want to ask about a modifiction of the below line i want to know is it right or wrong and why?
Programm3r wrote: char Value[] = variable;
first:Programm3r has made a mistake here that he assigned a value var to a pointer.
second: i think it may be
char value[];<br />
&value[0] = variable;
thanks for your reply
******************
******************
** Ahmed Ismail **
******************
******************
|
|
|
|
|
I am developing an SDI application that communicates with an instrument. The application have 2 threads: GUI and a communication thread. Until now I have used the following method to deliver data from the comm-thread to the GUI:
ViewWnd = ((CFrameWnd *)AfxGetApp()->m_pMainWnd)->GetActiveView();
ViewWnd->PostMessage(WM_MY_MESSAGE, 0, (LPARAM)PostString);
Is this a good solution? If not? What do You suggest?
|
|
|
|
|
Did it work?
Please post more detailed code.
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
It does work. I just wondered if this is good solution.
Here's more detailed code:
commthread:
ViewWnd = ((CFrameWnd *)AfxGetApp()->m_pMainWnd)->GetActiveView();
CString *PostString = new CString;
*PostString = "This is a test";
ViewWnd->PostMessage(WM_DATA_UPDATED, 0, (LPARAM)PostString);
GUI:
ON_MESSAGE(WM_DATA_UPDATED, OnDataUpdated)
long CZFGMCommunicatorView::OnDataUpdated(UINT wParam, LONG lParam)
{
CString* InString= (CString*)lParam;
GetStatusBar()->SetPaneText(0, str1 + *InString, 1);
delete InString;
}
What I wanted to know:
Is the view is the best class to handle this or is the frame a better choise. Or if it is better to just write a member function in the gui and access this via a pointer to gui...
|
|
|
|
|
In my opinion an alternative solution to PostMessage is adding of a member function to your view, and then calling it directly:
CMyView * ViewWnd = (CMyView*)(((CFrameWnd *)AfxGetApp()->m_pMainWnd)->GetActiveView());
ViewWnd->MyUpdateFunction(PostString);
I think this works faster comparing with PostMessage .
I hope this helps.
|
|
|
|
|
That's fine, you just have to make sure PostString persists long enough (and unaltered) to be handled by the GUI thread. One way to do this is alloc PostString in comm thread, and free PostString in GUI thread. If you are sending a _lot_ of strings then the repeated alloc/free overhead _may_ become an issue.
...cmk
Save the whales - collect the whole set
|
|
|
|