|
call the CListCtrl::Arrange() method after you size the list control.
nave
|
|
|
|
|
yes i got that thanks a lot. how to display the contents of a file while clicking it
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
You mean a behaviour similar to explorer? you can use ShellExecute() for this.
nave
|
|
|
|
|
yes thank u very much
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: hi i have to display the files and folders of a drive in listview control. how to arrange it in tiles form?
create ListView with small icon format
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
i came to know that we can import MS word using MS sdk kit through which we can control the buttons..how it will be possible?With which version of visual studio it will be available?
|
|
|
|
|
Hello everyone,
I heard when define a struct, it is important to make the size of the struct memory aligned.
For example,
<br />
struct foo<br />
{<br />
char p;<br />
char[3] align;<br />
};<br />
<br />
struct goo<br />
{<br />
char p;<br />
};<br />
struct foo is better than struct goo, even if we only use member p.
Allocate 3 bytes to align with memory. But I do not know why make memory aligned is better. Any reasons? (for example, prevent memory from running out?)
thanks in advance,
George
|
|
|
|
|
Putting in your own padding is usually superfluous. The compiler will do it for you, and it will match up the padding to the alignment requirements of the CPU that you are targetting.
|
|
|
|
|
Thanks Mike for answering another question.
I want to know if the compiler does not do it for me directly, why do we need to pad, and what are the dis-advantage if we do not pad?
regards,
George
|
|
|
|
|
George_George wrote: But I do not know why make memory aligned is better. Any reasons?
Read this[^]
|
|
|
|
|
The link does not work, could you provide an alternative one?
regards,
George
|
|
|
|
|
George_George wrote: The link does not work,
Works for me.
|
|
|
|
|
Nibu, I have checked some other resources. It seems that using memory alignment will improve performance by others' points.
But I do not know why alignment will make memory reading operation faster. In my case, foo needs to fetch 4 bytes and goo needs to fetch 1 byte. Even if each time, CPU fetch 4 bytes, I think they should be the same performance, right?
Why do you think memory alignment will improve performance? An example?
regards,
George
|
|
|
|
|
George_George wrote: Why do you think memory alignment will improve performance? An example?
Did you go through the article. It has some good explanations.
|
|
|
|
|
hi:
when i am lisetening to Sharing printer the function of FindNextPrinterChangeNotification wii be fails,and GetLastError()
saying "the handle is invalidation" .
if the prinnter is local ,FindNextPrinterChangeNotification will obtain information about the change.
my code is here
h_change_notification = FindFirstPrinterChangeNotification(h_printer,
PRINTER_CHANGE_JOB ,//0,PRINTER_CHANGE_ALL,
0,
&printerNotifyOptions);
if(h_change_notification == INVALID_HANDLE_VALUE)
{
MessageBox( NULL, "FINd FIRST Error", NULL,MB_OK);
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL);
MessageBox(NULL,"FindNext Error",lpMsgBuf,MB_OK );
this->m_listeningStatus = LISTENING_OFF;
return FALSE;
}
this->m_listeningStatus = LISTENING_ON;
while(endLoopInd == 0)
{
return_value = WaitForSingleObject( h_change_notification,50);
switch (return_value)
{
case WAIT_OBJECT_0:
return_value = FindNextPrinterChangeNotification(h_change_notification,
&dw_change,
&printerNotifyOptions,
(void **)&printerNotifyInfo);
if(return_value == 0)
{
//error handling
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL);
MessageBox(NULL,"FindNext Error",lpMsgBuf,MB_OK );
this->m_listeningStatus = LISTENING_OFF;
return FALSE;
}
-- modified at 22:28 Tuesday 3rd April, 2007
|
|
|
|
|
|
Maybe use WMI...check out the Win32_BaseBoard WMI class.
There's many articles here on CP about using WMI if you need them.
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Can you give me some code? thank you.
|
|
|
|
|
Type in "WMI" in the "Search" box above and click "Go!". You can then narrow the search to just
C++ related articles
Here's a link to one article: Getting Information from WMI in Visual C++[^]
As you can see, WMI coding in C++ gets a bit wordy.
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
You can use the WMI class Win32_MotherboardDevice
|
|
|
|
|
sun_shb wrote: thanks
for WMI you must need how to use com interfaces in vc!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hi all,
I'm using C to write a socket program.I want to add in that server program that it will accept only the password from the client if it's "mypassword":
i'm not writing any client program. the client will be the built in linux Telnet program
so the session will be between the server and client as follows
1. telnet 192.11.11.9 password "mypassword".
2.then the server if recieved the password "mypassword" it will connect if not it will close the connection.
I want to know how i can make the server program recognize that the pasword is right or wrong..how i can write it in the server
Thanks
|
|
|
|
|
Hi,
Telnet clients doesn't connect just like that - for telnet connection is special protocol - helping documents:
Telnet protocol: RFC 318
Telnet protocol specification: RFC 854
Telnet options specifications: RFC 855.
-----------
Mila
|
|
|
|
|
You could write an interactive login sequence.
For example your server sends the text line "Enter your authorisation" immediately when a client connects, then evaluate the first newline terminated response from the client. However, this simple approach works with most telnet clients only on a non standard port (other than port TCP 23)... I would strongly recommend to implement the full telnet protocol or at least look for IAC sequences in the server code (RFC 854).
Hope this helps.
|
|
|
|
|
I am using Visual C++ (I know, no duh) Intro ed. I have been lookin at the "Interoperating with Windows Media Player using P/Invoke and C#" B Alex Kent and it told me to use the System.Runtime.InteropServices namespace in my code, but every time i try to use it the compiler tells me it isn't a namespace. I might just be being stupid or something, but could someone help please!
|
|
|
|