|
CString str = "http://server/sharanu/inbox/test.jpg";
int i = str.ReverseFind('/');
str = str.Left(i);
CString sValue1 = str.Right(str.GetLength() - str.ReverseFind('/') -1);
i = str.ReverseFind('/');
str = str.Left(i);
CString sValue2 = str.Right(str.GetLength() - str.ReverseFind('/') -1);
|
|
|
|
|
sir i am new in c++.we are just doing general program in c++ like adding two numbers or nested classes.sir can you help me in network nprogramming and how to learn about other headre files and reserved variables like time_now.if you have ebook please give me the link.
|
|
|
|
|
What has to do your message with its title?
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
[My articles]
|
|
|
|
|
Per your post's subject, see SetLocalTime() and SetSystemTime() .
"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
|
|
|
|
|
How do I go about entirely disabling a Tree View's selection? I want my app to focus on a node via the user's mouse and not by the default of the keyboard selection. Otherwise, the keyboard selection does not follow the user's mouse clicks.
|
|
|
|
|
Hi,
I have a custom ListCtrlEx which embeds a combobox in it. When the selection of combobox changes I am sending a user defined message to its parent(ListCtrlEx here) using GetParent()->SendMessage() and from ListCtrlEx again to its parent that is the dialog box(here) and handling the message there for identifying the changed row and coloumn. Now my query is if I use 2 ListCtrlEx controls in one dialog box, How do I identify from which ListCtrlEx I got the notification from?? Whihc parameter should I pack in WPARAM so I can uniquely identify the ListCtrlEx which send the message.
Any help would be appreciated.
With Reagards
Vikas
|
|
|
|
|
the ID or the window
Vikas_123 wrote: Whihc parameter should I pack in WPARAM so I can uniquely identify the ListCtrlEx which send the message.
You may use either the ListView control ID or its window handle.
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
[My articles]
|
|
|
|
|
Hi,
I am getting a linking error while using the following code from MSDN.
BOOL IsUserAdmin(VOID)
/*++
Routine Description: This routine returns TRUE if the caller's
process is a member of the Administrators local group. Caller is NOT
expected to be impersonating anyone and is expected to be able to
open its own process and process token.
Arguments: None.
Return Value:
TRUE - Caller has Administrators local group.
FALSE - Caller does not have Administrators local group. --
*/
{
BOOL b;
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
PSID AdministratorsGroup;
b = AllocateAndInitializeSid(
&NtAuthority,
2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&AdministratorsGroup);
if(b)
{
if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
{
b = FALSE;
}
FreeSid(AdministratorsGroup);
}
return(b);
}
|
|
|
|
|
|
I have linked Advapi32.lib.. But still getting this error.
|
|
|
|
|
Check whether you've included that library in your both (or all of) configuration (i.e. Release, Debug). I suspect that.
- Malli...!
|
|
|
|
|
No.. It is included. I am using vc++6.0. I doubt whether this works in VC++6.0.. I am not sure.
|
|
|
|
|
Can you please paste the linking error here ?
- Malli...!
|
|
|
|
|
Since CheckTokenMembership() is on Windows 2000+, you may not have
a library in your old SDK that has the export (if you're using an old SDK).
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I have a Parent Dialog on which there is a child dialog with three Group Boxes . Is there any way that i can change the background of the three group boxes. The group boxes are having certain static labels which have value during run time as well as statically.
So please tell me the way to change the background of the group box which is a part of child dialog.
I am working on mfc.
Thanks In Advance.
Dhiraj Kumar Saini
|
|
|
|
|
|
|
I am trying to use the tab control in VS2003, I have added the tab to a dialog template in the dialog editor and used the TCM_INSERTIEM message to add my tabs to the tab control. My question is how do I add a child window to a specified tab? (not using MFC BTW).
|
|
|
|
|
There's lots of info and some sample code here:
Tab Controls[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi.
We are doing TCPIP communications between an old system (DOS) and a WinXP system. We put all the message contents into a struture. Because the DOS side we can not change, we encountered a few problems that seems to be related to byte alignment.
I think on the windows side, it needs to be 4 byte aligned. But on the DOS side it seems to be 2 byte aligned. As a result, it seems when you access a specific variable using pointers or use "sizeof" it gives the wrong result.
Is there anyway to force the alignment correctly so that nothing will be "padded"?
Thanks in adavnce.
Stan the man
|
|
|
|
|
Use pragma pack around your structure definition:
#pragma pack(2)
struct MyStruct
{
..
..
};
#pragma pack()
|
|
|
|
|
HI.
Thanks for the reply. IT only needs to be around the definition call. I do not have to do anything else when I call it or use it then, right? Just want to be sure...
Thanks.
|
|
|
|
|
Stan the man wrote: IT only needs to be around the definition call
What do you mean by "definition call" ? Anyway, it only needs to be around the structure definition. When you use the structure afterwards, the byte alignment will be on two bytes (in this case).
|
|
|
|
|
|
In addition to what Cedric wrote, note that packing alignment may only be part of the problem. Type sizes may be different in old DOS-based software, so an struct member of type int may only be 2-bytes wide in DOS as opposed to 4-bytes wide in Win32.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|