|
-If you use MFC toolbox to create it, change style it to
Drop List in Styles tab.
-If you use code, use style: CBS_DROPDOWNLIST
Try it !
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
Has anybody successfully used the function LogonUser(..) ?
I can't do it because i allways get the error message: ERROR_PRIVILEGE_NOT_HELD
which means that the calling process hasn't the SE_TCB_NAME privilege. How do i get that privilege ??
|
|
|
|
|
struct Inst
{ char Iname[20];
char Office[10];
float salary;
int InstId;
char phone[10];
}
void main()
{ Inst ISInst1;
Inst* InstPtr;
.
.
}
How much space will the ISInst1 variable take up in main memory. How much space will InstPtr take? Can you explain this to me?
Loli10
|
|
|
|
|
This question does not have a single answere since it depends on the target machine, your compiler, compiler settings...
If you run on Win32 and use VC compiler with standard settings I'd say your struct will take up 52 bytes of memory. There are 4 'hidden' bytes in there. two comes after Office, and 2 after phone. This is due to byte alignment. For efficiency, datatypes like float and int are put an a 4 byte boundary. This allows the CPU to fetch your data in a single call.
If you want to check the size of your datatypes you should use the operator sizeof(), e.g. int instsize = sizeof(struct Inst). This will also show that your pointer is 4 bytes (again depending on the target machine)
If you are familiar with pragmas you could try putting #pragma pack(1) before you declare your struct and se what happens.
Hope that helps.
|
|
|
|
|
Good single answer
Regards,
Alvaro
Always do right. This will gratify some people, and astonish the rest. - Mark Twain
|
|
|
|
|
The easiest way to find out would be to use the sizeof operator:
int viSize1 = sizeof(ISInst1);
int viSize2 = sizeof(InstPtr);
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
would anyone have an example how to get a drives freespace
i know the call but...
thanks
shotgun
|
|
|
|
|
<br />
DWORD dwsectorsPerCluster,<br />
dwBytesPerSector,<br />
dwNumFreeClusters,<br />
dwNumTotalClusters;<br />
if (GetDiskFreeSpace("C:",
dwsectorsPerCluster,
dwBytesPerSector,
dwNumFreeClusters,
dwNumTotalClusters))
{<br />
DWORD dwFreeSpaceInBytes =<br />
dwNumFreeClusters * dwsectorsPerCluster * dwBytesPerSector;<br />
}<br />
|
|
|
|
|
...or you could use the GetDiskFreeSpaceEx(...) which will give you the free space in bytes directly.
|
|
|
|
|
Hi !
I have several databases (in mdb format) for my MFC project. I decided to put them on a server in the network. The path is like this:
//netbackup/multimedia/erginasil.mdb
The problem is: The server (netbackup)has a password which I have but the users will not have.If I first connect there ,the program runs normally. How can I acces a password protected server in the code. I found in msdn opening a password-protected "file" but I must give the "server password" to connect normally.
Thanks in advence..
|
|
|
|
|
Can you not just share the folder and give the users permissions to access that one folder?
Michael
|
|
|
|
|
No I don't have the right to give permission. I am not the admin of the system. In fact I am building this program for him. And I don't want to tell him "you must give permissions to the other users for this program". Just becaouse this I have to try.
|
|
|
|
|
No I don't have the right for that. I am not the admin. In fact I am developing this program for him and I don't want to say "you must give access to other users for my program".So I have to find.
|
|
|
|
|
How can I implement word wrapping in regular edit controls w/o resorting to subclassing as much as possible.
|
|
|
|
|
Don't use WS_HSCROLL style and multiline edit control will wrap words.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
I´m not a socket expert but I´m currently working with sockets and need to ask something to the "socket-addicted-cpians". My question is: Does socket library only works on TCP/IP networks or it works on local networks with other protocols (like IPX and NetBEUI) ?
At my point of view it should only work on TCP/IP.
Thanks
Mauricio Ritter - Brazil
Sonorking now: 100.13560 Trank
My latest article:
Pentominos - A C# implementation of the famous Puzzle Game
|
|
|
|
|
TCP and UDP, as far as I know. That's it.
Michel
If I am wrong or said something stupid, I apologize in advance
|
|
|
|
|
Michel Prévost wrote:
TCP and UDP, as far as I know. That's it.
Nope, it works with all the IP protocols. You can use raw socket to communicate with the other protocols like ICMP.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
you are right. my mistake. sorry.
Michel
If I am wrong or said something stupid, I apologize in advance
|
|
|
|
|
You are right, it only works with IP networks.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
My MFC UI program runs a command line executable and I need to retrieve the data that is outputed to the command prompt and put it into my UI.
Any Ideas?
|
|
|
|
|
|
Apropos of this question, does anyone know if VC++ 7 (.NET) fixes _popen so that it works in Windows apps? In VC++ 6 there were some bugs that prevented it from opening the streams properly.
|
|
|
|
|
Hi all,
I'm looking for an API to call the Add Printer Wizard from within my c-code.
I'm running under Windows ME.
Any help will be welcome
Haim
|
|
|
|
|
ShellExecute(
NULL,
NULL,
"rundll32.exe",
"shell32.dll,SHHelpShortcuts_RunDLL AddPrinter",
NULL,
SW_SHOWNORMAL);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|