|
It looks straightforward to me: what's your trouble about?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CStdioFile Class
CEdit::SetWindowText
|
|
|
|
|
Hi all,
i am using ReadDirectoryChangesW synchronously to monitor a Drive...when ever any file is copied the same is validated and deleted if the file fails the validation check..and the loop continues its wait for next change on the directory monitored...however, when i copy a folder there is an issue..if the folder is invalid and deleted, then the code exits out of the loop of monitoring the directory....i am using recursive deletion to delete folders which are found invalid......
please could i get some help on how to fix this issue......
|
|
|
|
|
Without seeing your code it is impossible to guess what your program is doing. Please edit your message and add the relevant part(s) of your program, and don't forget to use the code block button to surround the code with <pre></pre> tags, to help readability.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
I am trying to multi-thread my OpenGL code but I have been having trouble. At first, I thought that using opengl inside an alternate thread was impossible, so I just did loading operations and passed the data to opengl in the main thread (I knew once I started passing too much data the main thread would lockup, and noticeably freeze the execution of the program while the data was being moved). I found some forum threads discussing opengl and multi-threading but they don't discuss the details that I'm looking for. namely, how and where do I use wglMakeCurrent() and wglShareLists().
I have been trying to create a display list in the alternate thread with the instructions outlined in the aforementioned forum posts but it crashes every time. I can load the model data, I can even load shaders, but loading a model (of any size) crashes the program.
I will show some code snippets but there is really too much to put in one post:
if (!(app.hDC=GetDC(app.hWnd)) ||
!(PixelFormat=ChoosePixelFormat(app.hDC,&pfd)) ||
!SetPixelFormat(app.hDC,PixelFormat,&pfd) ||
!(app.hRC=wglCreateContext(app.hDC)) ||
!(app.hRC_thd=wglCreateContext(app.hDC)) ||
!(wglShareLists(app.hRC, app.hRC_thd)) ||
!wglMakeCurrent(app.hDC,app.hRC))
{
KillGLWindow();
return false;
}
This next bit is all the initialization and render using opengl
GLuint o;
vector<v3> v,n;
vector<v2> u;
vector<face> f;
bool done = false;
void load_thread(void* null)
{
wglMakeCurrent(app.hDC, app.hRC_thd);
load_rs_shdr();
load_obj("cell.obj", v,n,u,f);
gen_display_list(o, v, n, u, f);
done = true;
return;
}
bool init()
{
init_med(v3(0,0,0));
set_light_const(v3(0,10,0), v3(1,1,1));
_beginthread(load_thread, 0, (void*)0);
return true;
}
bool render()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
gluLookAt(0,0,5,0,0,0,0,1,0);
if(done)
glCallList(o);
return true;
}
I know for sure that my loading functions work, I've been using them for a while now inside my single threaded apps.
I appreciate any help or suggestions anyone has.
|
|
|
|
|
Hello ,everybody !
I want to get the whole screen shot in the SDI project,then save it to a bitmap file.
usually ,the shot just relative to the Device. I want get the whole view's screen shot ,whether the view is be hide by other window.
Is there anyway ?
Thanks for your reply !
|
|
|
|
|
Bring it to the front before taking the screen shot??
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Thanks !
your mean's than call some funtion to show at first. but I think this isn't the goodness.
Is there other way ?
|
|
|
|
|
As far as I know, when you do a screen shot, you get what is on the screen. If part of your content is hidden by other windows, then you need to bring it to the front to take a screen shot. If it is too large for the screen and is partially hidden because it has scrolled, then you have a different problem.
Perhaps someone else has a better idea.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
|
Koma Wang wrote: Is there anyway ?
Yes, you can send the window the WM_PRINT[^] or WM_PRINTCLIENT[^] message and ask the win32k subsystem to paint into the device context you pass in the wParam. Not all windows support these messages (such as windows using DirectDraw) so your results may vary.
Best Wishes,
-David Delaune
|
|
|
|
|
Thanks !
I have a try soon.
|
|
|
|
|
Hi all,
i m using ListCtrl of Report View Type with checkbox property,
i want to identify when i click on ListCtrl its click on list item or checkbox.
i m using this code on NM_Click function
NMLISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
LVHITTESTINFO hitinfo;
hitinfo.pt = pNMListView->ptAction;
UINT uFlags;
int item = m_Err_List.HitTest(&hitinfo);
if(item != -1)
{
if (uFlags & LVHT_ONITEMSTATEICON)
{
AfxMessageBox("Click on checkbox");
}
}
here message display in both case whether i click on check box or on list item
please help me how can i do this.
thanks in advance
|
|
|
|
|
You have not initialised uFlags to any value so the test is based on whatever arbitrary value exists there.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
please tell me what value
|
|
|
|
|
Le@rner wrote: please tell me what value
I am not sure, what is it supposed to represent? Take a look at the documentation for the message you are decoding to see what values can be returned, and where they are in the message packet that is received in your code.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Try CListCtrl::HitTest[^] on for size...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Since the checkbox can only exist in the first column (item 0 ), check for that instead.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
I am getting fault address error in my program. I am running the program in release mode and error is not coming constantly. When i check stack it shows adress 0x0000 or any other garbage address. I do not find any function name in call stack.
My program read data from a hard drive (asynchronously). After reading i process data. Sometimes error occured at address say 0x10000 or sometimes 0x20000. I can not reproduce error at same address and there is no hint for me how to detect error.
Is there any way to know where is the actual problem in my code.
|
|
|
|
|
The normal place to start is to try reproducing the error in a debug build running under a debugger.
Steve
|
|
|
|
|
|
I am using _wtof() to convert CString to double but I am not getting the actual double number code is below:
CString szStr;
szStr = _T("4.6");
double fVar = _wtof(szStr);
I am getting 4.599999999
How can I get 4.6 after conversion?
modified on Saturday, November 13, 2010 5:28 AM
|
|
|
|
|
|
Another poster already asked similar question already (http://www.codeproject.com/Messages/3644795/What-is-the-best-way-to-break-return-from-OpenMP-l.aspx[^]), but I'll ask anyway.
I have a function that checks if a point belongs to an object in array. The loop looks like this:
for (int i=0; i<N; i++)
{
if (point_is_in_object(obj[i], pt){
return true;
}
}
return false;
I parallelized it with OpenMP by adding shared boolean flag found .
bool found = false;
#pragma omp parallel for
for (int i=0; i<N; i++)
{
if (!found)
{
if (point_is_in_object(obj[i], pt){
found = true;
#pragma omp flush (found)
}
}
}
return found;
Is this a good way to do this? Could this cause access violation when one thread is writing and the other thread is reading memory contents of found flag?
I'm new to OpenMP and don't know much how it operates under the hood. With standard Win32 I would isolate access to found with critical section. Should I do the same here as well and add critical clause?
Thanks
|
|
|
|