|
Most Significant Bit is dropped naturally
|
|
|
|
|
thank you thats put my mind at rest
|
|
|
|
|
Hi! I want to know how to get current Identity. I need to know which of wab or OE identities are currently in use. Strange thing is that i can retrive WAB entries on allready logon client but i don't know who he is.
Probably this function will return such string {C9DB85FC-7CA3-4CE7-850B-81F9B94CCD14} which what im looking for
Pain is a weakness living the body
|
|
|
|
|
I'm not sure exactly what you are after, so let me start here. If you know the account name and want the SID, use LookupAccountName() . if you know the SID and want the account name, use LookupAccountSid() . Am I way off?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
VS.Net 2003/Visual C++.Net
MFC
Windows 2000
I have a CTreeCtrl in a dialog box (created programmatically, not from a resource). Even though I specify the WS_EX_CLIENTEDGE extended style, the tree control is inially displayed without a border, and without any kind of 3D appearance.
HOWEVER...
If I expand the tree items to the point that either a horizontal or vertical scrollbar is displayed, the 3D appearnce magically appears, and does not go away as long as the property sheet is displayed.
Anyone got any hints?
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
What if you force the control to repaint?
Ant.
|
|
|
|
|
Tried that.
And I tried setting the normal windows styles (in addition to and instead of the extended styles) as well.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote:
If I expand the tree items to the point that either a horizontal or vertical scrollbar is displayed, the 3D appearnce magically appears
That sounds like the non-client area isn't getting calculated or painted properly. When the scrollbars are added, they go in the non-client area and force a recalc/repaint, which also makes the border appear.
Try calling:
tree.SetWindowPos ( NULL, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED ); SWP_FRAMECHANGED is the important flag, that will make the control recalc its non-client area.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
I even hear the Windows "OMG I booted up fine" sound.
-- Paul Watson diagnosing hardware problems.
|
|
|
|
|
You, sir, are a god. That did it.
I tried MoveWindow earlier, but neglected to include that flag.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
Hi !! I'm programming in MFC. I want a CStatic label control to have font color at red. I don't know how to do it, because I'm using this code:
CFont* my_font = new CFont;
my_font->CreateFont(here all the parameters that I need...);
but I can't see anything for the color... What can I do ?? I think that I've to do something with CDC or something... but please, if you could show an example...
Thanks in advance !!
|
|
|
|
|
Yes you have to use CPen pen(..) and then pDC->SelectObject(pen);
don't forget to free resorces DeleteObject(pen)
because after some time our application my behave in funy way
Pain is a weakness living the body
|
|
|
|
|
CPen is for line drawing. You need to use CDC::SetTextColor(COLORREF) to choose what colour the text gets drawn in.
Roger Allen - Sonork 100.10016
Strong Sad: I am sad I am flying
Who is your favorite Strong?
|
|
|
|
|
Rafael Fernández López wrote:
but I can't see anything for the color...
Thats because the control's font has nothing to do with the colour being displayed.
One method that I use is to implement the WM_CTLCOLOR message handler, and set the draw colour (SetTextColor()) for all or individual static control.
Or you can use a derived label class like this: CLabel[^].
I Dream of Absolute Zero
|
|
|
|
|
Does anyone have a tutorial about adding C++ (Visual Studio) code as a macro in Excel. Need to know this for some job interviews. Thanks
|
|
|
|
|
That I know of, the macros used in Excel (and all of Office) are VBA (a derivative of VB), not C++.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Do you mean how to create a COM Add-in? Because Excell macros are VBA code, not C++, but if you are referring to Add-ins, your COM class must implement the IDTExtensibility2 interface in order to work with any MS Office program.
Do a search on the MSDN on IDTExtensibility2, also you can take a look to this article, Comaddin.exe Office 2000 COM Add-In Written in Visual C++, it is a Win32 project that you can use as starting point, but I suggest you to use ATL to help yourself with this task.
Fabian
|
|
|
|
|
Yes, this is it!! Thanks for your help.
Regards
Chris
|
|
|
|
|
Hi, I must get a string from a function included into a DLL, imported in a ASP.NET page.
The code:
----
Into a .aspx.cs page:
//def. function included into a DLL
[DllImport("WebUtility.dll", EntryPoint = "getDescr")]
public static extern string getDescr(int id);
//call the function:
string descr=getDescr(123);
---
into the c++ program, the function is definied as:
char* getDescr(int id) {
char* ret=new char[LUNGHEZZA_STRINGA_MEM];
strcpy(ret,oggetto[id].descr);
return (ret);
}
If I throw the application, the server give me the error: System.NullReferenceException: Object reference not set to an instance of an object.
But this error is generated not every time, but random!! some time I can view the string correctly! Why?
Thanks for the help!!!
|
|
|
|
|
You can try
[return: MarshalAs(UnmanagedType.LPStr)] However, that's going to be tricky: what frees the string?
If you control both the C# code and the DLL, I'd change your API so it takes a string pointer and a size:
BOOL GetDescr( int id, char* pBuffer, int bufLen )
{
if ( bufLen < LUNGHEZZA_STRINGA_MEM )
{
return FALSE;
}
else
{
strcpy( pBuffer, oggetto[id].descr );
return TRUE;
}
} then call from C# like so:
[DllImport( "WebUtility.dll", EntryPoint=GetDescr )]
public static extern bool UnsafeGetDescr( int id, StringBuilder buffer, int bufLen );
public static extern string GetDescr( int id )
{
StringBuilder sb = new StringBuilder( LUNGHEZZA_STRINGA_MEM );
if ( !UnsafeGetDescr( id, sb, sb.Capacity ) )
{
return null;
}
else
{
return sb.ToString();
}
}
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Ok, thank you vary much, using your suggestion I solved the problem!!
Matteo
|
|
|
|
|
Hi Friends,
Our product uses shell integration to extend the functionality of the explorer. when doing some internal operation i may get crash. Explorer then dies. Instead of try/catch in each functionality I need a generic solution so that i can do some cleanup at the time of crash.
(i)I tried with Hooking windows messages but i am not getting the quit/destroy message when the explorer crashes abrubtly(Terminate process)
(ii) I tried with some solutions in the internet for monitoring the process but it is complex with additional server / dll that is injected with all process. Also this solution causes performance difference.
Can any one of you please help me to find a simple solution so that i can handle this situation.
jothi
|
|
|
|
|
Have you tried some low level debuggers like softice or WinDBG?
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
Thanks for your reply.
Sorry, I dont know the usage of these debuggers.
Can you please explain more details about that.
jothi
|
|
|
|
|