|
Given that the network adapter is disabled, call WSAGetLastError().
Kuphryn
|
|
|
|
|
Hi,
I have a multi-view application which displays different view of the same 3D OpenGL object. Because it's the same 3D object for all views, I just need to build the display list (using glNewList) once. The call list is build is the CMainFrame class.
My problem is that I need to use glCallList in each view. But the function glCallList creates an error when it is called from another class than CMainFrame. Do you have any idea of what's happening ?
Thanks.
Jean Bédard
Optifor Inc.
Québec, Canada
|
|
|
|
|
I would like to give more details:
The list is created in CMainFrame like that:
// Delete previous list
BuildList(){
::glDeleteLists(1, 1);
// Create new list
::glNewList(1,GL_COMPILE);
...
::glEndList();
}
Then, each view call BuildList() after setting the display context. The first view that create and display the list is working fine. But each subsequent view produce the following behavior:
-when calling glCallList(1), the error code 1281 is return.
Also, when calling glIsList(1), I get a "false" value.
Obviously, the display list does not exist after the first call to glCallList(1)
Thanks for your support!
Jean Bédard
Optifor Inc.
Québec,Canada
|
|
|
|
|
Since you have multiple views I am assuming you have multiple OpenGL rendering contexts. A display list is only valid in the context they are defined. First you have to have an active context in order to create and use them, and you can not use a display list, created while another context was active(current).
But nothing is without its solution, take look at wglShareLists in MSDN or better your favorite GL book.
Examining your code more deeply...
Create display list names with glGenLists, do not give your own name (eg. 1).
Your problem is, you give the same name (1) for all your display lists for all the contexts, and I think you end up with only 1 display list which is valid under the last context you created, you delete the other ones. So when you glCallList(1) with another context active you get GL_INVALID_VALUE(1281).
PS: if you are comfortable with linking with glu32.lib, you can use gluErrorString to make your error descriptions more understandable.
Orhun Birsoy
|
|
|
|
|
I am trying to set a bitmap on a button dragged from the toolbox. I checked its bitmap property. I do:
if(m_but1.GetSafeHwnd())
{
m_but1.SendMessage( BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)(HANDLE)hicNewIcon);
}
where
hicNewIcon = theApp.LoadIcon(IDI_ICON1);
Initially my button comes up with no windowText. A button click on another button is supposed to show the bitmap on my button. SOmewhere I am doing something wrong....
Thanks,
ns 
|
|
|
|
|
|
Nope. Its a member of the class.
Thanks for helping.
ns
|
|
|
|
|
hi:
I have some dialog application which are in dll,and now I want to call these dialogs in an another dialog(I named it as dlgMain ).I want to switch them by clicking buttons in the dlgMain just like we switch propertypages by clicking tab.
thank you.
code is best.;P
Happy Gemini
|
|
|
|
|
Which #include "??" need for
::QueueUserWorkItem ( WorkItemFunc, param,0);
Winbase.h; include Windows.h. - not works.
does such asyncro items are executed in other thread ?
So, thread context changes,
and all thread dependent methods would make error?
Is there methods with no thread context change ?
Or resoring it for other thread?
Thanks.
|
|
|
|
|
You need to #include <windows.h> , and you need to ensure that you've defined _WIN32_WINNT to be at least 0x0500 . QueueUserWorkItem is only available in Windows 2000 and later.
I suggest you read the MSDN Library section Thread Pooling and Jeffrey Richter's book Programming Applications for Windows.
If you need to keep some context for the operation, you should allocate a block of memory on the heap, and pass a pointer to that block as the Context parameter to the QueueUserWorkItem function.
|
|
|
|
|
I read book you proposed,
and MSDN.
but sources is big,
and Idea you supplied is not clear:
What is the context ?
Will the context considered,
for example by MFC methods,
if call made from other thread,
with rhat context,
as it was in main thread ?
Please sent topic Name,
with description of what context
does for such problem.
Thanks for consideration.
|
|
|
|
|
I am still learning MFC so please excuse my "newbieness".
Is accessing the registry every 1 second to read the data and every 8 seconds to write to it a bad idea?
If not is there any method to store heirachal (spelling) data based on keys and values like say PHP Arrays? CStringArray seems to be based off only numerical keys and values.
Any help is appreciated!
|
|
|
|
|
Depends upin your task,
need some explanation,
does add, changes or what?
So: it is sequencive writing or random ?
If sequencive- use ini file, from artivcles
on this site.
If Random and data is big use ACCESS database- it hightly optimized for
random data access.
Or possible to create randomly accessed file for self, but it not so easy as
ACCESS or registry, unreliable.
If no performance problems happens- still use registry.
|
|
|
|
|
Depends. Here is the scenario:
Every 1 Second:
Data is "read" from registry (Note: not written)
Every 8 Seconds: (Can be 3-5 too)
Data is updated in registry (Note: not read)
I so wish that there was some hierachal arrays in MFC, could have made life so easier.
|
|
|
|
|
Ii is not understandle what "depends" ?
Arrays is not disk stort feature.
(It has no reflection on the disk,|except structural storage that is some complex).
Registry is better fot you,
data not big, (not 10.kbytes)
due to 1 second is big time for update computers and
registry is not sequencial optimized store.
|
|
|
|
|
The only drawback to using the registry is it limited size in Windows 2000 and below.
XP removes the limits because it is now mapped into the cache address space and isn't charged for more than 4MB of memory.
Also, using the registry for data storage isn't really the quickest method. If performance is an issue, you should check into either developing your own storage class or using possibly using XML.
RageInTheMachine9532
|
|
|
|
|
Varun Shoor wrote:
Is accessing the registry every 1 second to read the data
Why the need for such frequency?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I want to switch Fibers in other thread,
in Main thread from Second thread.
(Main thread creates two Fibers.)
but after calling SwithToFiber(pFiber),
in second thead leads to Fiber execution
in this thread, second (that called to swith)
but not native to Fiber,
so that Fiber in initial thread remain not changed.
For make switch possible it is need to convert second thread to fiber - does it correct?
It there way to switch Fibers, so they remain in main thread?
Is there methods to to split execution in thread,
remaining thread context same?
(for controlling it threads ?)
Thanks.
|
|
|
|
|
I have code to put a window image on the clipboard as CF_BITMAP, using the screen's active color depth (typically 24 bits/pixel). I'd like to force the image to something of lower color depth, e.g., 8 bits/pixels or 256 colors. Is there a simple way to do this with Windows APIs, without adding an image-management library? Thanks, -M
(Optimism is a contagious; infect someone today.)
|
|
|
|
|
Hi,
When I use the CreateFile for Open, Read, Write and Close , when I using COM1, to COM9 no problem.
But when I would like to use COM10 to COM34. I cannot open Comport.
I using this command :
CreateFile(\\\\.\\COM10,...)
or
CreateFile("COM10",...) cannot workink.
Can you help me
youssef
|
|
|
|
|
hi,
how to capture Alt+F2 keys in pretranslatemessage. any one help to me.
Thanks in advance
Murali.M
|
|
|
|
|
if (pMsg->message == WM_SYSKEYDOWN)
{
if (pMsg->wParam == VK_F2 && (HIWORD(pMsg->lParam) & KF_ALTDOWN))
TRACE(_T("Alt+F2 was pressed\n"));
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
thanks for suggestion.
Murali.M
|
|
|
|
|
I need sample for using Fiber
(win32 threading),
and founf that one there is at OLD MSDN as
"Fibers Sample: Fiber-based File Copy Operation"
(130 MB to download proposed -in total C++ sample archive)
can some one who have old MSDN or have else
source for other Fiber sample
send it ti me,
or reference to the sample ?
Thanks
grigoriev@arktika.ru
|
|
|
|
|
hi all,
i am trying to use as it is the rijndael algorithm..for encrypting and decrypting the xml file...using AES rijndael..32 bit key and block size and also the method is CBC..it adds a few characters at the end of the file which makes it an invalid XML file..while using BLANKs..I am getting the valid XML file..Now i have to do is a server side encryption of the XML files..from php script..so i am using mcrypt library to do the same..but when i use this class to decrypt the same file it says can't secrypt..while i am using the same key and all..there the function is MCRYPT_RIJNDAEL_256..CBC and ECB..but nothing is working..can anyone help me out there in doing the same..or if there is any encryption which works as same in php and vc++ so that i just have to use the function and can do the same..Please help me out..any pointers and ideas are highly appreciated..
Thanks a lot in advance..
Regards,
Himanshu
|
|
|
|