|
267, Invalid directory. I know that the problem is the passed directory; setting it to NULL "fixes" the problem. Trust me that I pinned it down as much as I could and excluded any other possible problems.
|
|
|
|
|
Could you pass that directory to the PathFileExists() function and check what it returned?
|
|
|
|
|
As I said, the string is empty. A previous function, which is used to set the directory variable, checks whether the directory exists or not and empties the string otherwise. Again, I excluded all possible problem sources - it is just not "that easy". I still believe that it is a compiler bug (and it fails in both Debug and Release builds, so I guess it's not just a strange optimization...).
|
|
|
|
|
lpCurrentDirectory
[in] Pointer to a null-terminated string that specifies the current drive and directory for the new process. The string must be a full path that includes a drive letter. If this parameter is NULL, the new process will have the same current drive and directory as the calling process. (This feature is provided primarily for shells that need to start an application and specify its initial drive and working directory.)
An empty string would be wrong for this parameter, as you've said yourself.
I'd be tempted to do something like:
LPCTSTR szDir = strDir.GetLength () ? strDir : NULL;
and use szDir in your CreateProcess call - that'll make it easier for your debugging to verify what you're passing to the function.
If the directory really exists, try using filemon from www.sysinternals.com to see what checks windows does on the directory. Maybe is has to not only exist, but have some permissions set? Maybe it has to be readable by the current user?
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
I am not talking about an existing directory - the directory string is just empty (and I checked that a million times). In fact, even if I never touch the variable holding the directory it still fails for some reason.
(strCurDir.IsEmpty() ? NULL : strCurDir)
This is the part that fails. Even if IsEmpty() returns true, it still passes something invalid (an empty string as I assume). And I used your workaround already, and yes, it worked. I am not really looking for a solution, I just want to know why that simple statement fails, even if it is correct. But I guess it's really a compiler bug... can't explain otherwise.
|
|
|
|
|
In my application I am posting test results (description, result) to a list view using the following code;
void PostDataTroubleCodes(HWND hwndDlg, int DataToPost)
{
int Flags;
char *PostData[20];
HWND hList;
hList = GetDlgItem(hwndDlg, LV_PIDDATA);
memset(&LvItem, 0, sizeof(LvItem));
LvItem.mask=LVIF_TEXT;
LvItem.cchTextMax = 256;
LvItem.iItem=0;
LvItem.iSubItem = 0;
LvItem.pszText = "";
LvItem.pszText = "Number of emission related codes";
SendMessage(hList, LVM_INSERTITEM, 0, (LPARAM)&LvItem);
Flags = DataToPost;
itoa(Flags,LvItem.pszText, 10);
LvItem.iSubItem = 1;
SendMessage(hList, LVM_SETITEM, 0, (LPARAM)&LvItem);
LvItem.pszText = "";
}
The first time data is posted all is well, the second time however instead of the description the results are posted to iSubItem 0.
Thanks you in advance for your help.
|
|
|
|
|
Changed LvItem.pszText = "Number ...." to strcpy(LvItem.pszText, "Number ....");
Thanks
|
|
|
|
|
hello
i read lines from file as : getline(infile,word);
but i want put condition :don't read the spaces that in begin of lines
this problem appear with me now when i end my project
|
|
|
|
|
You cannot put a condition like that but remove space after reading a line. Look at trim left spaces in this[^] article.
-Saurabh
|
|
|
|
|
thank you
functions in this articals was useful but when i try do the function ,apperar error on compile time say: #include "strutil.h" No such file or directory
|
|
|
|
|
hello
i used the function in that link and include the file (strutil)
but there is error as:
clear' : is not a member of 'basic_string<char,struct std::char_traits<char>,class std::allocator<char> >'
what can i do ?
|
|
|
|
|
|
|
I am getting an exception
001B:7C16E14F Ordinal1028+7D,
001B:7C16E1B8 Ordinal1209+3B,
001B:7C16E1F6 Ordinal1209+79,
001B:20004EE3 KIVCZ05VmDialogProc+603,
001B:77D48734 GetDC+6D,
001B:77D48816 GetDC+14F,
001B:77D489CD GetWindowLongW+127,
001B:77D496C7 DispatchMessageA+F,
Unknown,======================================================================
What is Ordinal1028 and how to fix this problem
|
|
|
|
|
problemfixer wrote: What is Ordinal1028
Possibly it is the ordinal number of the exported function inside the DLL.
problemfixer wrote: how to fix this problem
Well, the details you provided are not enough to.
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]
|
|
|
|
|
In my windows based application i am getting an exception log
001B:7C16E14F Ordinal1028+7D,
001B:7C16E1B8 Ordinal1209+3B,
001B:7C16E1F6 Ordinal1209+79,
001B:20004EE3 KIVCZ05VmDialogProc+603,
001B:77D48734 GetDC+6D,
001B:77D48816 GetDC+14F,
001B:77D489CD GetWindowLongW+127,
001B:77D496C7 DispatchMessageA+F,
Plesae guide me generally how we resolve ordinal problems.
|
|
|
|
|
|
scottmp10 wrote: I have a system tray derived from code I found on here.
If you are referring to a CodeProject Article, each one has it's own forum at the bottom of the page which is where questions about the article or it's code should be posted.
Oh, by the way, welcome to CodeProject
led mike
|
|
|
|
|
|
Hi, this app is in C++ using Visual Studio 6.0, without MFC.
Basically I need to get the main menu of my application as an HMENU; this is the menu that has "File," "About," etc. The menu has a resource ID: IDC_MAINMENU.
GetDlgItem doesn't seem to work. GetSystemMenu is the wrong menu. Is there a way I can get the primary menu of my application by using a resource ID? If not, is there another way to do it?
Thanks!
KR
|
|
|
|
|
KellyR wrote: Hi, this app is in C++ using Visual Studio 6.0, without MFC.
Basically I need to get the main menu of my application as an HMENU;
GetMenu()[^]
led mike
|
|
|
|
|
Yay, that was easy. Thanks!
KR
|
|
|
|
|
Like this:
m_menu=GetMenu();
m_menu=m_Menu->GetSubmenu(0);
|
|
|
|
|
Hi all,
This is a question of the form, "why do I type this" instead of "what do I type."
I'm importing some functions from local.dll. I've got a bunch of examples for doing this, and so I start writing these:
typedef int (*My_Function_Name_t)(int, int, char*, int);
typedef bool(*My_Next_Fxn_Name_t)(char**);
...
and then creating function pointers:
My_Function_Name_t My_Function_Name;
My_Next_Fxn_Name_t My_Next_Fxn_Name;
and then setting these to the functions in the dll:
My_Function_Name = (My_Function_Name_t)::GetProcAddress(localdll,"My_Function_Name");
...
Is this the only way to do this? Is there a better or newer way? I'd like to stick to C/C++ (not C# or .NET)
|
|
|
|
|
This is the explicit loading of the dll. It means that you first load the dll 'manually' using LoadLibrary and then retrieve the function pointers you want to call. This gives you some flexibility because you are able to manage the errors (if the dll is not present, LoadLibrary returns NULL, same with functions that don't exist,...).
There's another way which is the implicit loading: you let the compiler 'do the work' for you by including a header file and by linking to a static library both supplied with dll. The static lib contains information about how to load the dll (but not the dll code in itself). This is in general easier but it gives you less flexibility: if the dll is missing when you start your program, a windows error is shown and the program exits (and you can't do anything for it).
I suggest this article[^] if you want to see more in details how to do it.
|
|
|
|