|
Hello.
I have the dialog based application. I changed the dialog color in the InitInstance function using the following code: SetDialogBkColor(RGB(224, 235, 244));
I added the menu to the dialog. The color of the menu bar is not changed, it's still gray as was before.
How can I change the menu bar color?
Thank you in advance,
Olga Sayenko (olga@nisko.co.il).
|
|
|
|
|
The Menu-Bar is part of the Window's Non-client-Area. Only the Window's Client-Area is affected by the color you specified in SetDialogBkColor.
Changing the menu-bar's color is not supported without some headache, which consists of taking-over OnNcPaint() and somehow clearing the meu-bar-area to your selected color...
I think there was a codeproject article that talked about a hacky way to do this, but I can't find it...
BEHATZLAHA
|
|
|
|
|
dear all
In windows, from explorer, by clicking the right button
we can see the file properties, including the owner of the file.
How can I get that properties by the program in VC++,
I need the owner and also the property of access authority
such as : read only, read write etc
I am looking forward your reply
regards
hb.sapto nugroho
sapto@fstream.net
|
|
|
|
|
Are you talking about GetFileAttributes() ?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I am not sure if file owner and
file acess authority (readonly, readwrite,etc)
are in GetFileAttributes.
If the properties that I mean are also
can be taken by GetFileAttributes,
then tell me how to coding it.
regards
|
|
|
|
|
hb.sapto nugroho wrote:
I am not sure if file owner and
file acess authority (readonly, readwrite,etc)
are in GetFileAttributes.
Use GetNamedSecurityInfo() and LookupAccountSid() for owner. Use GetFileAttributes() for the other two.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
dear David
thanks for helping me.
I found difficulty in real coding.
Would you mind to write the sample coding of it.
I found error:
GetNamedSecurityInfo is not member of global namespace
also for LookupAccountSid.
looking your help
hb.sapto nugroho
|
|
|
|
|
hb.sapto nugroho wrote:
I found difficulty in real coding.
Does that imply there is "fake" coding?
hb.sapto nugroho wrote:
GetNamedSecurityInfo is not member of global namespace
also for LookupAccountSid.
How are you using them?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
How to take screenshots from the VC program?
|
|
|
|
|
|
Don't try it, just do it!
|
|
|
|
|
Nonsence answer.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
|
See if either of these two articles help:
http://flounder.com/screencapture.htm
http://flounder.com/printbitmap.htm
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thanks a lot, u read me well, I will check it an let u know
|
|
|
|
|
Hi,
I am struggling to convert some functions from a C++ DLL to some function references in VB.net
I dont program in C++, so I am hoping someone can help me with converting a couple of function prototypes:
This are the C++ prototypes:
CP2101_Open(DWORD dwDevice, HANDLE* cyHandle);
CP2101_GetProductString(DWORD dwDeviceNum, LPVOID lpvDeviceString, DWORD dwFlags);
CP2101_Close(HANDLE cyHandle );
This is what i have in vb.net:
Public Declare Function CP2101_Open Lib "CP2101.dll" (ByVal DeviceNum As Long, ByRef Handle As Long) As Integer
Public Declare Function CP2101_GetProductString Lib "CP2101.dll" (ByVal DeviceNum As Long, ByRef DeviceString As String, ByVal Options As Long) As Integer
Public Declare Function CP2101_Close Lib "CP2101.dll" (ByVal DeviceNum As Long) As Integer
I am not sure that I am converting the pointer data types correctly etc from C++ to Vb.net. If some could check my work.
Thanks
Barry
|
|
|
|
|
What problems are you experiencing here?
The VB declarations look OK to me.
Ant.
|
|
|
|
|
These
nelsonbd wrote:
This are the C++ prototypes:
not true!
These are C prototypes, else they would have very crazy export names in C++ name convention!
Don't try it, just do it!
|
|
|
|
|
The potential problem I see is in interpreting the LPVOID DeviceString as a ByRef String. If I remember my VB right, a ByRef String is passed to a C function as a pointer to BSTR. That may not be (probably is not) what the C function is expecting.
An LPVOID doesn't give very much information about what it is expecting: it could be a null-terminated string, a null-terminated wide-string, a BSTR or perhaps a pointer to BSTR. Do you have source for that C function, or a C example of its use?
|
|
|
|
|
Firstly, you should normally use System.IntPtr for opaque pointer types when using VB.NET. This will help you if you ever port to 64-bit (the IntPtr type is 32 bit in a 32-bit process but 64 bits in a 64-bit process).
As for CP2101_GetProductString, if the C/C++ code is interpreting the lpvDeviceString parameter as a string, you should use
Public Declare Function CP2101_GetProductString Lib "CP2101.dll" ( _
ByVal DeviceNum As Long, _
ByVal DeviceString As String, _
ByVal Options As Long) As Integer ByRef indicates an in/out parameter. If the function alters this data, you should use a StringBuilder object instead (still passed ByVal ), and set its Capacity to the maximum size you expect the function to write.
If you're getting MissingMethodException s, your DLL's exports may be mangled. To verify this, use dumpbin /exports . If the output contains ? characters and no recognisable function names, the names are mangled. You have two choices. Either you can rewrite your declarations to use the DllImportAttribute rather than Declare, and use the EntryPointName property to indicate the mangled name, or you can specify extern "C" in front of the exported function declarations to tell the compiler not to mangle the names. Remember that the latter will break binary compatibility with any existing clients.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi guys,
A question:
I got a class A that has a overridden copy constructor and assignment operator.
I derive class B from A.
*If B does not have an overridden copy constructor or assignment operator will the assignments of objects of class B invoke the copy constr. or assign operator of class A for the A part of class B(if you know what I mean)?
eg:
class A
{
class A();
class A( const A& a);
A& operator=(const A& a);
...
};
class B: public A
{
...
};
int main()
{
B obj1, obj2;
...
obj2 = obj1; //is operator= of class A called?
B obj3 = obj2; // is copy construct of class A called?
}
Greetings,
Davy
|
|
|
|
|
no, you ll have to modify like this
B obj1;
A obj2;
obj2 = obj1; //operator= of class A is called
A obj3 = obj2; //copy construct of class A is called
but remember ur objects will have to be sliced..
greatest thing is to do wot others think you cant suhredayan@omniquad.com>
messenger :suhredayan@hotmail.com
|
|
|
|
|
Suhredayan P wrote:
ur objects will have to be sliced..
woah whats that ?
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
Can you set a breakpoint on the line(s) in question to see what happens?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Can someone pls provide me with an algorithim that generates an random number ( 0 to 1000)and it cannot generate the same random number more than once.
|
|
|
|