|
You can use of
void CfilelistDlg::OnBnClickedCancel()
{
...
...
instead
<br />
void CfilelistDlg::OnBnClickedCancel()<br />
{<br />
...<br />
...<br />
Chris Maunder said :
"If you are posting source code with your question, place it inside pre /pre tags"
|
|
|
|
|
thanx will do it next time
|
|
|
|
|
Thank you
|
|
|
|
|
hi..
can anyone tell what are the parameters to be passed to initialize RIL API to get notifications on incoming call.
this is the function i hav used..but it does not initialize successfully..
HRESULT RIL_Initialize(1,NULL,Notif,RIL_NOTIFY_CONNECT|RIL_NOTIFY_DISCONNECT, NULL, NULL);
thanx
|
|
|
|
|
Hi, I need to use XmlDocument in C++, do I have to use managed c++? If not, what header files do I have to include? Thanks!
Nathan
|
|
|
|
|
No, you don't need to use managed C++. See this[^] link for MSXML examples. Personally, I prefer to use TinyXML[^]. (It doesn't do everything MSXML does, but what it does, it does well.)
/ravi
|
|
|
|
|
Hello,
I am using the MFC archive mechanism (serialize) to write out my document data. So I have something like:
void MyDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
ar << somedata;
}
else
{
ar >> somedata;
}
}
How do I attach an icon to the file I have written out?
Thank you!
Max
|
|
|
|
|
maxmaven wrote: How do I attach an icon to the file I have written out?
By "attach" do you mean (a) save an icon to the file, (b) associate an icon with the file or (c) something else?
/ravi
|
|
|
|
|
I believe what I am wanting is (b) associate an icon with the file. So, the file is created by the serialize machinery in MFC, perhaps it is called "binky". But there will be a file extension, so it will actually be "binky.dzq" or some other file extension. And the file will have an icon, so that when you view the file in the regular explorer file view (not internet explorer), you will see the file binky.dzq has a nice icon picture so users will know this is a file created by/for my application. How would I get an icon to appear like this on my serialized file?
Thank you!
Max
|
|
|
|
|
This is nothing to do with serialization, then.
In the registry under HKEY_CLASSES_ROOT there are a number of keys corresponding to an extension, such as ".acl". This has an unnamed (default) value of "Agent.Character.2", for example. This relates to another key which again, has a default value. This is the description of the file as it would appear in explorer. Also under there is a key called "DefaultIcon" which contains a string describing where to get the icon for the file, normally the name of an exe or dll with an icon index.
If you want the user to be able to double-click on the file and have explorer launch your app, you need to look at the shell and shellex keys. Have a browse for stuff like .xls etc if you have office installed, and you'll see what I mean.
Normally, MFC apps take care of this by calling CWinApp::RegisterShellFileTypes(), but if you are a non-admin user, then you cannot write to the relevant bits of the registry, so this should really be done by an installer.
BTW, are you a Terry Pratchett fan?
Steve S
Developer for hire
|
|
|
|
|
Hello Steve,
Well, you have introduced me to a whole new area of programming that I am not familiar with. Do you happen to know of a tutorial or discussion that I can look at to learn more?
Thank you,
Max
|
|
|
|
|
hi all -
I just started working with all this so my terminology may be bad.
Im using VC++ with winsock2.h and glut.h
A piece of software is outputting a signal via TCP/IP; I initialize a socket and can read data from it by using recv() within a while loop.
however, when I put the data acquisition code within the display function of an openGL loop, the data acquisition stalls (no error message). I think this is because the server is sending data faster than the client can receive so it stops. I was thinking of perhaps using an asynchronous implementation where the TCP/IP data is retrieved by a function running in parallel with the display loop. Do you happen to know a way of doing this? It seems like there are similar mechanisms used within the OpenGL loop to get input from the keyboard, which suggests to me that the GLUT display loop isnt blocking the main function.. is this true?
ga
|
|
|
|
|
synapticleft wrote: I was thinking of perhaps using an asynchronous implementation where the TCP/IP data is retrieved by a function running in parallel with the display loop. Do you happen to know a way of doing this?
http://www.codeproject.com/opengl/GLBase.asp[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
thanks.
If i increase the buffer length of the argument i pass recv(), i can prevent the connection from being dropped. there is still a little stuttering in the graphics, i presume from when the program is waiting for recv() to complete, so perhaps ill look into threads.
Gautam
|
|
|
|
|
Have you considered using non-blocking sockets?
Speaking about socket concepts, possible alternatives are from the view of a client:
a) blocking (read data available then wait blocking until more is available)
b) threaded (one ore multiple threads per socket, comes with inter-thread communication)
c) asynchronous (handling multiple sockets, application is typically event based)
The concept always depends on your requirements, I prefered last one in my past projects because it is flexible. There are of course more variants, such as polling (regular check if more data is there and then read it, however then you could also use the asynchronous concept and save CPU cycles).
Hope it helps
|
|
|
|
|
Hello All !!
I am using visual studio 6.0
I tried to access the private class member outside the class using #define macro.
here is the code. I was able to access private member outside the class? why did this work? This should be allowed or not?
<code>
#define private public
class A
{
private:
int i;
public:
A()
{
i = 44;
}
};
int main()
{
A obA;
cout<<"\ni = "<<obA.i;
cout<<"\n";
return 0;
}
</code>
sanket
|
|
|
|
|
Defnitely It is not a bug.
Because Pre-processing happens before the compilation process.
So first the pre-processor would process your #define and replaces the text "private" with the text "public", and then it would be processed by the compiler.
Cheers
|
|
|
|
|
Thanks!!
but dont you think this should not be allowed??
sanket
|
|
|
|
|
It is the responsibility of the developer not to use such constructs.
Cheers
|
|
|
|
|
sanket.patel wrote: but dont you think this should not be allowed??
play VB if you're age to play with a plastic hammer.
if you code in C/C++, know that you can break much more than that.
don't code what you can regret later...
|
|
|
|
|
VB and C# are languages written to cater to the lowest common denominator. C++ assumes a level of skill in the developer. #define is a hangover from C, which C++ is derived from. The designer of C++ would prefer it was not there, but it's still true that his design philosophy is to give the language powerful features and assume his users know how to use them.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: #define is a hangover from C, which C++ is derived from. The designer of C++ would prefer it was not there, but it's still true that his design philosophy is to give the language powerful features and assume his users know how to use them.
A hangover, maybe, but it is o so powerful. But with every powerful it should be used with care.
#define is a dangerous tool in the hands of the unexperienced.
codito ergo sum
|
|
|
|
|
BadKarma wrote: hangover, maybe, but it is o so powerful.
I agree with Stroustrup. I try to avoid using it whever I can, I think it's a poor tool. But, it is powerful, and no doubt can be used effectively at times.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You got sig-ed. 'nce again.
VB and C# are languages written to cater to the lowest common denominator. C++ assumes a level of skill in the developer. - Christian Graus
|
|
|
|
|
sanket.patel wrote: #define private public
sanket.patel wrote: I was able to access private member outside the class? why did this work?
of course you could !! you told it (with the #define) to replace each private keyword occurence by public... so that every private member is actually public.
why on earth where you trying to do with such horror ?!
|
|
|
|