|
It is unlikely that open file dialog box should even notice that one of its controls leaves in another thread. It is my understanding that you have a window in another thread where opengl draws something, is that correct? Opengl on another hand, as understand, needed to be initialized per thread.
|
|
|
|
|
hi Alex0,
actually it works the problem was that, since the code i used was a quick cut-and-paste from another standalone modeless dialog source, i forgot that when the dialog was created it was immediately hidden and the thread was suspended.
now, if the open dialog was still visible (i guess there is some piece of code rejecting the hide order) the thread routine responsible for opengl management was actually suspended hence no scene display. i've removed the problematic lines and all is fine now
|
|
|
|
|
Hello,
I have an App. based on a CFormView, when I size my App. and than open a random file, the app. is sized back to its initial size. Any ideas to keep it from sizing back? This behaviour seems to be by design because I created a new project with the Classwizzard and didn't add any code and it still sizes back to its initial state!
Thanks,
Arjan.
|
|
|
|
|
I'm working on a logon-replacement for Win2k and WinXP (a new GINA).
From the logon-dialog I have to play a sound (prompt the user to log on), but PlaySound fails. LastError is "the operation completed sucessfully".
Is there any other way to play sound?
The funny thing is, if I log on and then log off again, PlaySound works fine. It's like the sound drivers don't get started before I log on.
I have the same problem with recording sounds, but I havent looked enough at this to say what functions that fails, but it looks like I have no soundcard...
[edit]When recording waveInOpen fails...[\edit]
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
hi i have a problem
in my project i have to take a Object of a class(Master object). and then define another object of that class (Temporary object) that holds the same contents as the master object. if i change contents of this Temporary object the master object should take no changes.
for example if i define these 2 objects as pointer (node * master; node * temp;) and then i equalize these 2 object (master=temp;) if i change temp , Master object will be changed also.
i think this is becouse of Structure of the pointers.so is there any way to define another object of this class that get the Master Contents and even i change temp contetnts the master object take no changes.
in visual C++ ver6.0 i can define this : node * master=new node; node tmp=*master;
but in visual C++ .Net even use this structure an Error Occures : Cannot convert from node to node
how can i fix this ?
thnkx and sorry for my bad english
class node{
public:
int k;
ink l;
};
void main(){
node *master;
node *tmp;
tmp=master;
tmp->k=10;
node a;
node b;
a=b;
}
|
|
|
|
|
Hi, you need to clone the object so that master and tmp point to different things. This can be done like this:
...
node * tmp=new node(*master);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
COOL . this is a Great function and works in Visual C++ 6 also. but it seems that the structure of Clone object in Visul C++.Net has been changed. do u know the same code in this version Plzzzz ???
thanksss
|
|
|
|
|
What Clone object? Don't mean to be rude, but I think you're lacking the basic notions of how to program in C/C++. If you have the time I strongly recommend you buy/download some tutorial on C++ programming to guide you in your venturing into C++ land.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
thanks anyway. i am studing C++ for 2 years and i know all of the properties of pointers. but i am using Visual C++.Net MFC imvironment and it seem that the definition of class and some other sructures are changed.
when i use node * tmp=new node(*master) simply i called copy constructors of master object. plz can u tell me the code in .Net ? i realy need it.
|
|
|
|
|
thanks anyway. i am studing C++ for 2 years and i know all of the properties of pointers. but i am using Visual C++.Net MFC imvironment and it seem that the definition of class and some other sructures are changed.
Accept my excuses then, but by your posts one would think you were getting lost in the very basics of the language.
when i use node * tmp=new node(*master) simply i called copy constructors of master object.
Thats's it.
plz can u tell me the code in .Net ? i realy need it.
This is most strange, cause the node * tmp=new node(*master) is 100% basic C++. It should work in VC.NET. I don't have that compiler, maybe some kind soul has it and doesn't mind giving it a try.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
oh my goodnesses. i was defining My Classes with the CWnd Base CLASS when it goes to be Copyied Compilier couldn't copy the base Class .
Thanks my friend.
u helped me to findout this
|
|
|
|
|
Hi
I was searching the post and found you helped others to solve similar problem. So I think you are the right person to ask. Some member told me it not possible. I need your help.I am trying something similar.
I am trying to close a dialog.
I have a dialog with some control on it and a push button. When I will click the push button, another dialog will display which is the clone of the original dialog with control.
I am tryig like this.
<br />
void CTesttoolbarDlg::CloneDialog()<br />
{<br />
<br />
CTesttoolbarDlg* cdlg = new CTesttoolbarDlg(this);<br />
cdlg->MoveWindow(400,300,300,300);
cdlg->ShowWindow(TRUE);<br />
<br />
CWnd* ww = this->FromHandlePermanent(this->m_hWnd);<br />
CTesttoolbarDlg* wcd = reinterpret_cast < CTesttoolbarDlg* > ( ww); <br />
CTesttoolbarDlg* cdlg = new CTesttoolbarDlg(*wcd);
cdlg->MoveWindow(400,300,300,300);<br />
cdlg->ShowWindow(TRUE);<br />
<br />
}<br />
I think I might be doing something wrong. I want after cloning the similar object point to two different memory
msc
|
|
|
|
|
class node{
public:
//the following will take care of a=b problem
node& operator = (const node & other) : k(other.k), l(other.l){}
int k;
ink l;
};
void main(){
node *master;
node *tmp;
tmp=master;//this is wrong
//1. both pointers uninitialized
//2. even if they were initialized(“p = new node;”), you just lost the pointer to tmp. tmp points to the same object as master now
tmp->k=10; //master->k also change to 10 // since tmp points to master now, it is not surprising changes to tmp are actually changes to master
/////////////
node a;
node b;
// the following is not a problem anymore
a=b; //ERROR : no opearator found witch takes a right-hand operand of type node
}
I would strongly recommend to read something about pointers. Something as bacis as Kernighan and Ritchie.
|
|
|
|
|
realy thanks. u explained me all of the problems of the code. i get what ever u said and i will use them in the code. thanks again
|
|
|
|
|
Hi all, I'm writing my own string library that needs to be super-fast (much faster than CString). I am well on the way but need an efficient way of allocating memory so that I don't get fragmentation when concatening strings etc. I have thought of a way for an allocation routine to do this whereby memory is always allocated as a base 2 block with the minimum being 8 bytes. This will allow the string to grow in size with little fragmentation on reallocation (and indeed less use of realloc). It will of course, always consume slightly more memory than is required to hold the string. All I need is a method for grabbing the highest order bit that describes the length of the string and bit shift it to the left e.g. say the string was "LENGTH" it is 6 chars long so the highest bit is (0100 - since 6 is 0110 in binary) and bit shift it to 1000. I would then malloc 8 bytes which is enough to hold the 6 char string and its 1 char null terminator. However, I'm stuck on finding the quickest method of getting the highest ranking bit. I know I can do it by testing 0100 & 1000, 0100 & 0100 etc. till I find a match, but I was just wondering if there is a better way? Any comments or suggestions on how to make a better string library would also be grateful.
Alan.
P.S. Also I notice that CString displays the actual string in the variable pane of the debug window, whereas mine displays {...} and you have to go to the next level to check what the string is, any ideas on how I can get it to display {"LENGTH"} would be brilliant too
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
Follow this link[^] for a routine based on succesive approximations.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello Joaquin, its been a while... . Thanks for the URL, you missed out one directory shift by mistake though it should have been ftp://cap.connx.com/pub/bitcount/LOGS/LOG2.C[^] ?
Many Thanks,
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
Ummm. Both URLs point to different files. Yours is based on conversion to double , mine on binary search. Try again, I've just tested the URL and is working OK.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
P.S. Also I notice that CString displays the actual string in the variable pane of the debug window, whereas mine displays {...} and you have to go to the next level to check what the string is, any ideas on how I can get it to display {"LENGTH"} would be brilliant too
This can be done by tweaking a file called autoexp.dat living somewhere inside the installation dir of Visual Studio. Check Oskar Wieland's article CStringW and CStringA
[^] for an example.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks very much Joaquin, this code will cut down my development time immensely! Thankyou. I am looking into the autoexp.dat file thing so hopefully I'll be able to see whats in the string a bit easier too.
Many Thanks (again)
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
sometime i must add the Variable in dialog,but sometime i don't need
why?
which control need add variable and which not?
please tell me, thanks!
Joise is a C++ fun!
|
|
|
|
|
It depends on the control. None of the controls "need" a member variable attached, however it does make life much easier when it comes to accessing the controls from your code.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
I copy files a.txt、b.txt and c.txt below C:\ directory to D:\ directory.
if D:\ directory has exists some files just like a.txt,It will pop a "Confirm files replace" dialog to let user choose one of "Ok"、"All"、"No" and "Cancel" button.I want to known which files replace the formerly existing files in the destination directory.
For some reasons, The Precondition is that I must use Windows Shell func
"SHFileOperation", not use "MoveFileEx" or other API.
There are some idea of mine:
1、Get the destination files (that has the same name with one of source
files) attributes, compare the different between them,judge which one
does Replace. to forbid file access collision with other
programmes, "lock" the destination directory utill finish copying
operation.
2、Hook the messages of "Confirm files replace" dialog.
But my trouble is:
for 1:How lock the directory or file? even lock successfully,
the dialog how can replace destination file?
for 2:What is the value of the dialog buttons ID? it is variable
in different OS? how to get the current copying file name?
Can you give me some advice? Any help are appreciated!
C/C++ code fans
|
|
|
|
|
I think if can watch a file do replace and get the operaion thread ID or HANDLE, we will finish the goal, but how to "watch"?
C/C++ code fans
|
|
|
|
|
I have build a simple web browser. It works fine in VS6.0 but when i run the same prog using eVC++ 3.0 the image i am trying to display is all distorted. I figured out that the VS6.0 one works becasue of the command "_setmode( _fileno( fp ), _O_BINARY )" which requires io.h and fctl.h However these header files are not part of the CE SDK. Is there another set of header files that will take care of this problem or is there a work around to it???
I really need some help with this one!!
sparky
|
|
|
|