|
So where is the problem?
The following code works just fine for me:
Note: I have used '\x5c'(ascii code for a single '\') instead of using '\\' in the string literal. The code works either way.
CFileFind find;
CString CurrentDirectory;
char CurrentPathName[444];
find.FindFile("C:\x5cWindows");
find.FindNextFile();
if ( find.IsDirectory() && !find.IsDots() )
{
AfxMessageBox(CurrentPathName);
currentDirectory = find.GetFilePath();
currentDirectory = currentDirectory.GetBuffer(currentDirectory.GetLength ());
strcpy(CurrentPathName, currentDirectory);
if(SetCurrentDirectory(CurrentPathName))
AfxMessageBox("success");
AfxMessageBox(CurrentPathName);
}
Bikram Singh
|
|
|
|
|
I have a problem:
I want to display the text in the caption bar as three parts.
first part will be left aligned, second part is centered and the third part is right aligned using the title bar font and that runs correctly using different windows themes.
Thanks for co-operation
|
|
|
|
|
1. Intercept the WM_NCPAINT message for the window
2. Get the width and height of the Titlebar: see the GetSystemMetrics() function in MSDN.
3. To draw the text, use DrawText() (MSDN), and use the lpRect member to specify the rect to draw in. You would need to calculate the 3 rects needed yourself. (left,center,right)
HTH
Bikram Singh
|
|
|
|
|
|
Hi,
I have a windows service written in VC++ 6.0.
I install it using the shell
sERVICEname.exe /service
Is there any other way to install it (using VS.NET Deployment wizard)?
Also, how can we uninstall the above service once it is installed?
Regards
Vipul Patel
|
|
|
|
|
vipul_vips wrote:
Also, how can we uninstall the above service once it is installed?
servicename.exe /UnregServer
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
vipul_vips wrote:
Also, how can we uninstall the above service once it is installed?
My guess would be ControlService(..., SERVICE_CONTROL_STOP, ...) followed by a call to DeleteService() . Also, OpenService(..., DELETE) will need to be called in order to get a handle to the service.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
How do I force the redisplay of a dialog box after it was hidden by
another dialog then unhidden ? If my application is idle the system
does this automatically but when my application is actively processing
data including serial IO it will not redisplay until it is idle again.
Can anyone help ?
|
|
|
|
|
The serial I/O code should be placed in a separate thread. This allows the main thread (the one that owns the UI) to remain responsive. By putting the Serial I/O code in the same thread as the UI, painting-related problems are to be expected.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
hi all,
i have a CListCtrl on a dialog box. i want to have the rows of the CListCtrl with variable height which is determined dynamically during program execution. i have used MeasureItem which is called only once to set the row height. also i have used DrawItem to draw the elements in the CListCtrl rows. also the CListCtrl used has three columns. how can i get columns in the CListBox
|
|
|
|
|
maxsteel wrote:
i want to have the rows of the CListCtrl with variable height which is determined dynamically during program execution.
You've found a limitation of list view controls. You might want to try a CListBox instead, which allows items to be of variable height (set the LBS_OWNERDRAWVARIABLE style).
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi all,
I always thought that it is possible to create own user rights in Windows XP like the ones you see in the "Local security settings" but I couldn't find anything about it.
Is this just impossible? Or how can it be done?
Thanks for any help,
Jens
|
|
|
|
|
|
How can I remove the caption bar from the frame widnow in an SDI app ?
ff
|
|
|
|
|
Without the WS_SYSMENU and WS_CAPTION styles, I'm not sure it would still be considered an SDI application. The WS_SYSMENU style can easily be removed in the frame's PreCreateWindow() method.
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~WS_SYSMENU;
return CFrameWnd::PreCreateWindow(cs);
}
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have been asked to see if I can use a Java control from within an MFC app. I don't know enough Java to know if this is possible. The control I am trying to hook in is the thinkmap control (http://www.thinkmap.com[^])
Does anyone have any idea of whether this is possible, and if so, how I would go about doing it?
"The way of a fool seems right to him, but a wise man listens to advice" - Proverbs 12:15 (NIV)
|
|
|
|
|
You can port Java code to C++ if that's what you mean.
I think it's called JRI but I'm not sure.
I have no experience myself though.
Hope it helps!
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Well the first thing is this, no Java can execute without a JVM context for it to execute in. Therefore you are not going to be able to just "use" a Java component in a Win32 application since there is no JVM context. After that there is a multitude of possibilities.
Their web site requires registration to get the White Papers and I don't have any requirements for your application. Therefore I can't make any informed comments on your particular situation.
|
|
|
|
|
Hello all!
I have a problem over which i cannot continue the project. Please, if anybody can, help me.
So, the task is: I have pdf document, i need to convert its colorscheme to the CMYK.
I will very happy with any idea on this point: libraries, algorithms, other apps that could be used from my program (e.g. via command line) etc. Please help, its very important for me.
I hope for the answer, thanks in advance.
|
|
|
|
|
|
Thanks a lot!
But how i can use it? i mean that i need to convert pdf document... Seems that it will be very much problems with pdf format if i use manual conversion of each pdf object.
Enyway thanks, Bikram Singh. Maybe you or somebody else know how to solve my problem with pdf document?
Good luck!
|
|
|
|
|
Well, pass in the RGB values and u get the CMYK values back. I dont know about PDF conversion, but the Adobe site does have the PDF specs i think...check that out
Bikram Singh
|
|
|
|
|
Norton antivirus's corporate version automatically discovers all the clients when installed on the server and THEN AUTOMATICALLY INSTALLS A client version of antivirus on the remote system
How does it do that ?
All the users and their IP address can be found out i guess , but how can it install on the remote machine ?
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
http://www.mastishk.com
|
|
|
|
|
After using the abysmal Sophos antivirus software, which employs a similar technique, I would guess that each machine will have a small client already installed. This client will download any new updates, and install them itself.
|
|
|
|
|
mailMonty wrote:
How does it do that ?
My guess is with RPC.
Remote Task Manager works in a similar fashion. When connecting to a remote machine, if it detects that the remote machine does not have the RTM service installed and running, it will install and start the service, and then connect. It is very seamless.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|