|
|
a char type IS an integer. it just is on 8 bits instead of 16 bits for short or 32 for long. int may be 16, 32 or 64 bits depending on the architecture.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
How SHCreateDirectory() can be used to create nested directories?
|
|
|
|
|
Here is Example.
let you want to Create a Directory "cp" in C:\
So call of funtion would be like this
CString <code>strDir</code>="c:\\cp";
if(<code>SHCreateDirectoryEx</code>(this->m_hWnd,strDir,NULL);
Now let you want to create a user Directory under cp
just after above code
strDir+="\\user";
if(<code>SHCreateDirectoryEx</code>(this->m_hWnd,strDir,NULL);
Now third and last Example,create a Monishanker directory in USER directory
strDir+="\\monishanker";
if(<code>SHCreateDirectoryEx</code>(this->m_hWnd,strDir,NULL);
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
From the docs:This function creates a file system folder whose fully qualified path is given by pszPath. If one or more of the intermediate folders do not exist, they will be created as well. So you don't have to do anything special.
--Mike--
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
I have a class member that is static because I want only one instance of it for all of the class' objects. However, I get linker errors (LNK2001) because the variable is used in other files. Is there a way I can have only one instance of a variable in a class but also not limit the scope of the variable?
Thank you,
Galen
|
|
|
|
|
did you #include d your class declaration file in the cpp file using your static member ?
did you also take care of the datas protection of your member (public , protected , private ) ?
if the member is use by another class, you might also say that the class is a friend one...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I have included the class declaration file in my cpp file. The static member is public. I want to be able to access the static member from the main function so making a class a friend wouldn't help here. Are static class members supposed to be visible outside the file they are declared in?
|
|
|
|
|
A normal static variable is not visible outside of the source file in which is is declared.
A static member function for a C++ class does not have the hidden 'this' pointer parameter at beginning of function. If you need to access the class data from within the static member function, you must explicitly pass in the 'this' pointer yourself as one of the parameters to the function.
A static member variable for a class means that there is only one instance of the variable no matter how many instances of the class are created. You can typically access the 'static' member variable from another file by using the class name ahead of the variable, such as MyClass::m_StaticVariable , and you have to make sure you include the header file, so the class definition exists, in the source file that is accessing the static member variable.
|
|
|
|
|
Hi everyone,
Using: VC++ .NET
My project involves sending a message from one computer to another.
I am using CSocket as the connection between these two computers. On the computer that receives the message, I am using the CSocket.Receive method to receive the incoming message. I have made it working, but somehow, I discover that when I call the Receive method on the receiving computer, the program 'hangs' (i.e. the form cannot move) until it actually receives the message. Is there in anyway helps to prevent this (the program does not 'hang', while still trying to receive a message)?
My client code goes something like this:
CSocket client;
client.Create();
client.Connect(ip,port); // ip and port have been specified before
client.Receive(&msgLength, 4); // i believe the program 'hangs' here until it gets something.
BYTE* msgByte = new BYTE[msgLength];
Thank you and your answer is greatly appreciated.
|
|
|
|
|
Hi,
I seem to be having a problem including a new class in my project.I have a separate file called calc.cpp/h to include the CCalc class.
But when i do the necessary things and compile/build it,then it gives me some class type redifinition error of some three different classes.
How do I remove this class type redifinition error and what could be the possible causes.
As soon as i include this class in any other file in my proj,then it gives the error saying class type redifinition of three other classes.
thanks,
Arjun
Arjun Mukherjee
Software Engineer
Hewlett Packard
|
|
|
|
|
it is common problem with c++ when you include same header file in two file and these two file including each other.
one possible solution is to declare you class header file this way.
#ifndef MY_HEADER_FILE
#define MY_HEADER_FILE
includes
...................
your class declartion
...................
#endif
this will gurantee inclusion of your class only one time.
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi Alok,
I have already done that,but I get that error anyway.This class type redifinition that i get is not for the new class(CCalc) that i included,but for some three other classes.
But,the error that I get is not for this class it is for some three other classes,and this error arises only when I use the include directive(#include<calc.h>).
c:\arjMuMS\NewEng\BackupNewMumsEngine\Vars.h(19): error C2011: 'CVars' : 'class' type redefinition
This is the error it gives me,I have a variable of CVars type declared and used in CCalc class.But i cannot figure out the problem.
thanks,
Arjun.
Arjun Mukherjee
Software Engineer
Hewlett Packard
|
|
|
|
|
maybe CVars is a class that already exist in the compiler's library...
you'd better define your class with a name you're certain that none already use it...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I am currently creating an application which requires to launch an application in backgroud and the user should not be able to see the application window. I am using CreateProcess API to launch the application in background and using the STARTUP_INFO structures's flag (STARTF_USESHOWWINDOW)to hide the newly launched application's window. But by doing this though the application is launched in background and is not visible to the end user the splash screen of the application is visible to the end user. I have tried manipulating few flags of STARTUP_INFO structure but it didnt helped. I am looking for any alternative way by which i can accomplish the aforesaid task or any usefull information????
Parag Jhavery
|
|
|
|
|
You might not be able to; if the application is coded to create and show a splash screen. However, most MFC applications pay attention to the /Embedding command line parameter and will not show the splash screen (and will remain invisible) under those circumstances. Have you tried contacting the developer of the application to ask them if they support something like a /nologo or /nosplash command line parameter?
If you wanted to get fancy, you could try two other things: launching the application on another, non-visible desktop, but you might have to figure out new ways to interact with it, or install a short-term hook (you will need to create a DLL for this) that can catch and "pop" the splash screen.
Peace!
-=- James
Tip for inexperienced drivers: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"! Articles -- Products: Delete FXP Files & Check Favorites
|
|
|
|
|
Hello,
How do i keep my Dialog Box always full screen?
My dialogbox class is not inherited from CDialog
class but CDialogBar class. It doesn't support
OninitDialog. Kindly answer my question.
Regards
Deepali
|
|
|
|
|
overide WM_GETMINMAXINFO or WM_size message,read more abt them in your local copy of msdn.
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
how to get network serial port emulation ?????
i want to get serial port information.
can i get?
i want to get this serial port is usable or unuseable?
|
|
|
|
|
Hi all;
I want to set a number for a function for example:
19928=myfunc();
and then by calling this number...
2:is there any way to have a handle to a process by giving
it's name?
Thanks.
|
|
|
|
|
why do you want this for ??
you cannot do that.
however, if you have many functions that may be called depending on an index, you could set them in a pointer-to-functions array...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
dSolariuM wrote:
I want to set a number for a function for example:
19928=myfunc();
and then by calling this number...
This makes no sense. Please explain further.
dSolariuM wrote:
2:is there any way to have a handle to a process by giving
it's name?
There might be another way, but the one I am thinking of uses Process32First() to get a list of running processes. Look through that list of processes until you find the one of interest. At that point you will have its process id and module id.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi
I am writing an application which needs to know if the user is having internet connection enabled or not.
I want this checking to be done automatically by the application, I donot want to pop up connect internet dialog.
Can anyone tell me if there is any API/function to findout that the machine is having internet connection.
Regards,
Ruchirdhar Dwivedi
RuchirDhar Dwivedi
Software Engineer
Windowmaker Software Pvt.Ltd.
Baroda, India.
|
|
|
|
|
mr ruchir use his api
InternetGetConnectedState
This function retrieves the connected state of the local system.
BOOL InternetGetConnectedState(
LPDWORD lpdwFlags,
DWORD dwReserved);
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
InternetGetConnectedState() only works for modem connections. It will return FALSE even if the user is connected via a network. The only truly correct method of knowing is by actually trying to connect to a known website. If it works, then you're connected. If it doesn't work, then you're probably not connected (not definitely - the website might be down).
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|