|
sweep123 wrote:
Then its the director of my program, it has not changed.
I believe we have a language barrier here, I have not idea what that means.
HINSTANCE ShellExecute(
HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
Try using the lpDirectory parameter of the function rather than changing directories, that's what it is for.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I am still confused!
In the DirTreeCtrl, I try and set the current directory to the on we have navigated to. (See code below)
if ( find.IsDirectory() && !find.IsDots() )<br />
{ <br />
strDirArray.Add( find.GetFilePath() );<br />
currentDirectory = find.GetFilePath();<br />
currentDirectory = currentDirectory.GetBuffer(currentDirectory.GetLength ());<br />
strcpy(CurrentPathName, currentDirectory);<br />
SetCurrentDirectory(CurrentPathName);<br />
}
Now when I double-click a file in the current directory, the displayed current directory via AfxMessageBox is the one my program started up in. Not the one I thought I set in the code above.
void CScriptingDlg::OnNMDblclkTree1(NMHDR *pNMHDR, LRESULT *pResult)<br />
{<br />
<br />
<br />
char currentdir[255];<br />
CString messageStr;<br />
GetCurrentDirectory(sizeof(currentdir), currentdir);<br />
ShellExecute(0, "open", m_strPath, NULL, "C:\\CSL", SW_SHOWNORMAL);<br />
messageStr.Format ("Current Directory = %s", currentdir);<br />
AfxMessageBox(messageStr);<br />
}
If however I use palbano suggestion in the ShellExecute command and specify the directory the script file runs OK.
But the current directory is C:\MyProgram\res and not C:\CSL. This is want I dont understand.
|
|
|
|
|
swep123 wrote:
do I need to process the string and insert the extra '\' character?
Only if you are declaring the string as a constant, like you did here:
swep123 wrote:
TCHAR CurrentPathName[] = "C:\\MyFiles\\Dir1";
Is 'find' a CFileFind object?
Bikram Singh
|
|
|
|
|
Yes,
CFileFind find;
Every time the directory changed I was trying to change the working directory:-
if ( find.IsDirectory() && !find.IsDots() )<br />
{ <br />
strDirArray.Add( find.GetFilePath() );<br />
currentDirectory = find.GetFilePath();<br />
currentDirectory = currentDirectory.GetBuffer(currentDirectory.GetLength ());<br />
strcpy(CurrentPathName, currentDirectory);<br />
SetCurrentDirectory(CurrentPathName);<br />
}
|
|
|
|
|
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!
|
|
|
|