|
In my MDI program one window is using OpenGL to draw and animate. When I close this window the images are still on the screen moving. I was wondering if this as ever happened to anyone.
|
|
|
|
|
I have a DLL with an entrypoint that dos not have any resources defined in it. How do I add resources to something like that? I need to add a few dialog boxes.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Open the project in CV++ and do Insert..Resource.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
That was it. Thanks.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Alternatively, you could use VC++.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Does anyone know how to animate inside a dialog box in MFC. Project must use MFC, otherwise I would not.
|
|
|
|
|
There's the CAnimate control. It needs an avi to play. You could also use an animated GIF file (I think) but you'd probably have to work harder at it.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Oleg Bykov's Add GIF-animation to your MFC and ATL Projects article features a control class called CPictureEx capable of presenting animated GIFs. The article is also posted on CodeProject, but the CodeGuru version is more up to date.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Those are for animated GIfs. I wanted to know if anyone knows how to animate OpenGL coding.
|
|
|
|
|
Oh, you didn't say a word about OpenGL in your former post.
Sorry I can't help you on this one , I'm no OpenGL expert.
Joaquín M López Muñoz
Telefónica, Investigaciñon y Desarrollo
|
|
|
|
|
There's an article here (I think it was here) about adding a view to a dialog box. Once you have the view in the dialog, you can probably render whatever you want in there.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks for the tip. Do you know how to stop lines in OpenGl from blinking if they are being redrawn.
|
|
|
|
|
Sorry, I know nothing about OpenGL.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Are you using double buffering ?
If you don't, this may be the answer.
Just render to a back buffer then swap at the end of OnDraw.
SwapBuffers(dc.m_hDC);
Jonathan de Halleux, Belgium.
|
|
|
|
|
I haven't used OpenGL for a long time, but,
Your dialog box is a Window like any other, you can possition and draw on it by getting a handle to it and using the standard CDC (or one of the helpers).
For OpenGL I would make use of a Frame Control, get the hwnd and show pictures of dancing girls in grass skirts. If thats your sort of thing.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
I use SetCharFormat function in my project and I use SetWindowText to output my text. When I run my programm on systems Windows 95/98 this function can print symbols with code upper then 127, but when I run it on system Windows 2000, it does not work. Can anybody help?
|
|
|
|
|
i have a dll containing a function which creates a listview and returns the handle for the listview. i have another function which hooks into the window procedure of this newly created listview so that it can change the background color of individual items. It uses SetWindowLong to trap the window procedure. Am i doing it right ?
The sample code is as below:
listviewhandle=alMakeListView(AWPARAM_PTR awParam,long x ,long y,long width,long height);
void WINAPI EXPORT alListChangeItemColor(HWND listviewhandle)
{
glPrevWndProc = SetWindowLong(listviewhandle, GWL_WNDPROC,(LONG)(WNDPROC)DoNotify);
}
LRESULT DoNotify(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_NOTIFY:
{
LPNMLISTVIEW pnm = (LPNMLISTVIEW)lParam;
switch (pnm->hdr.code)
{
case NM_CUSTOMDRAW:
{
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)lParam;
return(CDRF_DODEFAULT);
if(lplvcd->nmcd.dwDrawStage == CDDS_PREPAINT)
return CDRF_NOTIFYITEMDRAW;
if(lplvcd->nmcd.dwDrawStage == CDDS_ITEMPREPAINT)
{
COLORREF crText;
if(!(lplvcd->nmcd.dwItemSpec % 3))
{
crText=RGB(255, 0, 0);
lplvcd->clrText = crText;
lplvcd->clrTextBk = RGB(0,0,0);
}
}
}
default:
break;
}
}
}
return CallWindowProc((WNDPROC)glPrevWndProc, hwnd, msg, wParam, lParam);
}
Can anybody tell me what is going wrong with this code ? Been trying this for some time now and can't figure it out.
author
|
|
|
|
|
Hi,
How can i disable the scrollbar of my FormView?
with greetings
|
|
|
|
|
Do you still want to be able to resize the window?
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
I am writing a UDP server using MFC. I have a class CConnection which is derived from CWinThread. But since CConnection is to help communicate with each client, where do I add sockets to this class so that I can communicate with the client? Where do the methods OnReceive() and OnSend() go?
cheers!
Samuel
|
|
|
|
|
Hello, the codegurus around the world.;)
I'm wondering how long you write the code as the professtional programmer?
You had better make your job simple first.
1) Try to create the single client and server program.
2) And then, create the server to accept the mutilple user.
3) Then, add the code to download the target file in the server.
If you don't understand how to write OnSend or OnReceive of CAsyncSocket or CSocket,
mutiple thread program makes no sense at all.
Besides, CAsyncSocket and CSocket class uses WSAAsyncSelect(...) to insert the notification message to the target windows.
This means that you don't need the thread code, and create some struct object with the linked list working for the mutilple socket.
Please, don't send me your email to ask your individual questions.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
I have recently been given the task to insert the Multilanguage support in my application.My application is already working in the English language , after inserting the Multilanguage support , my application would be able to work for the Chinese, japnees, urdu languages ( extensible in the future).
This Multilanguage support will cause it effects only on the GUI level. My development envirment is in pure VC++. For all windows os.
Right now I have few clews ( directions) in which I can proceed on.
1) I should make a sepreate .rc file for each different language.
2) I should make a sepreate string handle file for each different language. And then I will use only those string handle file which is to be used.
3) If there exist a component then I should try to use that ( but I do not know the component name).
I require any kind of suggestion/information regarding it .
THANK YOU
M. AKHTAR AFZAAL KHAN
SOFTWARE ENGINEER.
|
|
|
|
|
|
I need to create a DLL from C++ and call some of its functions from VB/VBA and Fortran.
While creating the DLL I used/tried the /Gz option and also ' extern "C" '
The code below causes runtime error 453 although the function has been
exported as int ExtractInt(CString &Line)
Declare Function ExtractInt Lib "MyDll.dll" (ByRef Line) As Integer
// 'Line' is a CString and will be modified by ExtractInt
Function TestExtractInt() As Integer
Dim ValInt As Integer
Dim Text As String
Text = "12 Jack 3"
ValInt = ExtractInt(Text) // Should be 12
TxtRet = Text // Should be " Jack 3"
TextExtractInt = ValInt
End Function
Questions:
a) Where can I find documentation that describes how to call DLLs written in
C++ from VB (especially if MFC and CStrings are involved)?
b) What is wrong with my code?
|
|
|
|
|
CString is a MFC class, I don't think you can use CString parameters from VB or Fortran. Change your parameter to char*.
|
|
|
|