|
Using Ctrl + Tab You can navidate between the property pages.
|
|
|
|
|
Superb!
My 5 vote.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thanks.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hai,
i am having a doubt.
How to capture and terminate a worker thread..?
Thanks,
Manivannan
Born to win...!
|
|
|
|
|
Google search and CP search will give you best answer.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Since its your worker thread, I hope you've the worker thread handle. Look at the place where the thread is getting created. Then you can terminate it by calling TerminateThread() .
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Jijo raj wrote: Since its your worker thread, I hope you've the worker thread handle. Look at the place where the thread is getting created. Then you can terminate it by calling TerminateThread().
This is bad advice which, unfortunately, is given way too often. See here[^] for details.
Steve
|
|
|
|
|
Steve,
I read the article. Didn't realized that its these much dangerous. Thanks a lot.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Try to avoid use of TerminateThread.
You can use some condition to return from the worker thread function.
May be you can introduce some flag and when the fag is set to false you can return from thread function. Whenever you want to terminate the thread just reset the flag variable.
You can use Events also instead of flag.
modified on Monday, May 26, 2008 3:57 AM
|
|
|
|
|
|
I have to read a property file to get the values from it.
I am creating a generic DLL program were I have to put the path for this properties file in such a way that it can be accessed from anywere.
At present I am hardcoding it like..
char path[]="c:\properties\file.properties"
Now if the dll gets created with this path and the properties file is in another folder. how do I access it. Please help me with some suggestions.
I have to make it generic.
THANKS.
|
|
|
|
|
One simple alternative is Environment variables . Configure an Environment variable and set the path in it. Your application will be reading the file path from the env var. So that you can modify the filepath at anytime without modifying your application.
You can also use registry for keeping the filepath.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Now I do it in this way...
char *prop_path;
prop_path = getenv ("file.properties");
and get the following error..
error C2501: 'prop_path' : missing storage-class or type specifiers
error C2040: 'prop_path' : 'int' differs in levels of indirection from 'char *'
error C2440: 'initializing' : cannot convert from 'char *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
How shud i get rid of them .please suggest.
|
|
|
|
|
Which version of VC++ you are using?
VS 2003 and above there are a lots of issues with cast between char* and wchar*. If you have a newer version try using getenv_s or wgetenv_s functions.
I am using Visual studio 2002 and the following code runs sucessfully:
char* envVarVal;
envVarVal = getenv("PATH");
AfxMessageBox(envVarVal);
In any case, be advised that getenv() and _putenv() only affect the environment variables for your own process.
They do not add system wide accessable environment variable.
In case you require that, instead of setting environment variables, try storing the path of the file in the registry.
only dead fish swim with the stream
|
|
|
|
|
Ok fine.. But how do I store the path of the file in the registry.
How does it work.
THANKS
|
|
|
|
|
|
pl_kode wrote: At present I am hardcoding it like..
char path[]="c:\properties\file.properties"
Might be u could put your DLL in to C:\windows and C:\Windows\system32 folder. but that would be not right approach, if your are comfortable in COM, that you could make com dll. it would surly available, when ever you make the call with right interface.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hi everyone,
I'm trying to load a resource (mp3 file) into global memory so other apps can access the resource.
I use the combination of FindResourceEx/LoadResource/LockResource (it works perfect) and i'm able to get the pointer to the data but it's useless since i don't have access to the size of the resource so, apps don't know how many bytes to read. What can i do to get the data size???
Thanks in advance.
|
|
|
|
|
Use SizeofResource on the handle that you get from FindResourceEx
1. I will develop myself to the maximum of my potential in all ways
2. I will look for the good in all people and make them feel worthwhile.
3. If I have nothing good to say about a person, I will say nothing.
4. I will always be as enthusiastic about the success of others as I am about my own.
5. I will always remain loyal to God, my country, family and my friends - Chuck Norris
Ernest Laurentin
|
|
|
|
|
|
Using Visual C++ 6.0 MFC in SDI application
I want to setup an SDI program where the user can switch between client views (two initially and as I add more things possibly switch between more views). I found example code where I could do this using default client windows with no scrolling, but I don't understand how to set it up so that all the client views have scrolling capability. In a book that explained how to do this, they used non-scrolling views. But I can't use that code because it gets the active view and then loops through views of different classes comparing view classes. That code only works for views of CView type and not for views of CScrollView type. Any suggestions on how to do this?
Thanks ahead of time
modified on Sunday, May 25, 2008 7:05 PM
|
|
|
|
|
What is the solution of the diamond problem of Inheriting Classes.
A class is inheritting from 2 base classes and both the base classes have a function/method with the same name. From the object of the child class how we can call a function of the one base class.
|
|
|
|
|
If the functions have the same name but they get different parameters... only the function that fits the parameters should be called.
Function (int Par1, CString Par2);
Function (double Par1, int Par2);
is not possible to call both at once although they have the same name.
If both functions get the same number and typ of parameters, in the same order... then let's wait to another explanation from the high level users and I will learn it as well
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hope you are aware of run time polymorhism.
Keep the same name function/method as virtual function in the base class. For the derived class object pointer allocate the corresponding base class (whose function needs to be invoked) then call the function resulting the corresponding base class get invoked. See below to make things clear
class A
{
public:
virtual void show(){cout<<"Class A invoked"};
}
class B
{
public:
virtual void show(){cout<<"Class B invoked"};
}
class C: public A, public B
{
}
main()
{
C* ptr = new A;
ptr->show();
C* ptr1 = new B;
ptr1->show();
}
|
|
|
|
|
Muhammad Zeeshan wrote: A class is inheritting from 2 base classes and both the base classes have a function/method with the same name.
The class structure is as follows?
Base1 Base2
\ /
\ /
\ /
Derived
If this is the class structure, then its not a classic C++ diamond problem.
Muhammad Zeeshan wrote: From the object of the child class how we can call a function of the one base class.
Just prefix the base class name before the call. See the code snippet.
Derived DerivedObject;
DerivedObject.Base1::CommonFunction();
Derived* pDerivedObject = new Derived;
pDerivedObject->Base1::CommonFunction();
Does this solve your problem? Or is it something else?
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|