|
|
thax's Sohail Kadiwala
it is working..thx's once again..
|
|
|
|
|
Glad I could help.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
i have a problem to add these values in listbox.Problem is that i want to show according data.I mean first i want to show drive name then it's data then other drive name then it's data. Right now it is showing but mixed shoe.Code is here
[code]
DWORD dwDrives=GetLogicalDrives();
if(0==dwDrives)
{
// return FALSE;
}
DWORD dwCount=0;
char chDriveLabel='A';
char szRootpath[5]={0,0,0,0,0};
while(dwDrives !=0)
{
if ((dwDrives & 1) != 0)
{
sprintf(szRootpath,"%c:\\",chDriveLabel);
//removable drive
if(DRIVE_REMOVABLE==GetDriveType(szRootpath))
{
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
//Removable dirve lable
// std::cout <<"Files in " << szRootpath << std::endl;
m_ListCountries.ActivateTopParent();
m_ListCountries.AddString(szRootpath);
AfxMessageBox(szRootpath);
//* represent search all files and directories
szRootpath[3]='*';
hFind=FindFirstFile(szRootpath,&FindFileData);
if (INVALID_HANDLE_VALUE == hFind)
{
// return FALSE;
}
// List all the files in the directory .
do
{
//ignore the sub directories
if (!(FindFileData.dwFileAttributes &
FILE_ATTRIBUTE_DIRECTORY))
{
// std::cout << FindFileData.cFileName << ":";
m_ListCountries.AddString(FindFileData.cFileName);
// m_ListCountries.UpdateData(false);
AfxMessageBox(FindFileData.cFileName);
}
}while (FindNextFile(hFind, &FindFileData) != 0);
FindClose(hFind);
}
}
dwDrives = dwDrives >> 1;//next drive
chDriveLabel++;
}
[/code]
plz help me..
|
|
|
|
|
|
|
ex. I am address from memory is : char *s = "0x003c2750". I want get value of s ?
|
|
|
|
|
|
Naveen wrote: char cValue = *s
may be with a semi-column too.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Jijo raj wrote:
may be with a semi-column too.
compiler role will come to play than [ ]
"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/xml>
|
|
|
|
|
Well, s value is just 0x003c2750 .
Possibly you need *s value.
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
[Image resize DLL]
|
|
|
|
|
i think everyone is missing the point stated in the qns.
the qns states that
char* s = "0x12345567"
which is a null terminated string
and the poster wants to get the value of the memory 'pointed' by the string (not the pair of quotes around the address.
Thus *s will not work.
what you need to do is to parse the char* into a int or long (depending on whether it's 32bit or 64bit)
I believe this is what you wanted (thou it's almost 5 mths late )
char* s = "0x0012ec08";
char* stopString;
long address = strtol(s,&stopString,16);
void* pPointer = (void*)address;
depending on what is the value you want, you will then type cast pPointer to whatever type, for example
byte* pByte = (byte*)pPointer;
|
|
|
|
|
Hi,
I need to get the state of Radio Button ,According to the Radio button state i need to change the text on one push button.
Plz Advice.
Preethi.
|
|
|
|
|
Using raw Win32 use the BM_GETCHECK[^] message or the Button_GetCheck[^] macro. If using MFC you can use the CButton::GetCheck function.
Steve
|
|
|
|
|
Events and delegates are your friends here. This will let you change your button text anytime the selected radio button changes. Check google for more details. There should be plenty of tutorials out there. You may even find some code snippets in the articles here that do something similar.
Dybs
|
|
|
|
|
dybs wrote: Events and delegates are your friends here.
Delegates? Are you thinking of C#?
Steve
|
|
|
|
|
I was thinking Visual C++. I'll admit, I haven't done any MFC programming, my work is all in C++ .NET, where we do have delegates. I guess I should probably do a bit of reading up on MFC before posting anything in this forum again. My apologies if my previous post is misleading at all.
Dybs
|
|
|
|
|
Hi all,
I am working in vc6.0 using MFC.
I have a peculiar problem with Edit box display.
I have some parameters to display in edit box like,
Flash type : 0
Flash Address : 0x00
etc.
I need to align ':'character so that':' appears on the same column
So I am stuffing the Flash Type with spaces.
Eventhough I change the location of ':' to be same,
The edit box is displaying like,
Flash type : 0
Flash Address : 0x00
The alignment is not proper.But If I send the buffer to hyperterminal the alignment is proper.
Please clarify how can I align ':'in edit box.
Regards,
Sunil Kumar
|
|
|
|
|
sunilkumar.d wrote: Eventhough I change the location of ':' to be same,
The edit box is displaying like,
Flash type : 0
Flash Address : 0x00
Change the font of the edit control to Courier. As a hint to create a font use CreatePointFont( 120, _T( "Courier" ), NULL );
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Make sure that the "Flash type:" and "Flash Address:" labels (i.e., static controls) are the same width and are right-justified.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I am trying to compile
with the statement
CText* pTextElement = new CText(************
but get an undeclared identifier message
does any body know what I need to include in the header
files for this
please?
thanks Simon
|
|
|
|
|
I don't see a CText class in the docs.
Is it a control class? Looking for CEdit maybe?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You've told the compiler you want to use CText but have failed to declare such a class.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
are you using the tk library
may be you are missing some referance
Vikas Amin
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
right click on CText and click goto decalartion! and post the class content here
"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/xml>
|
|
|
|