|
Hi everybody,
can anyone help me ?
i'm developing a MFC Dialog based app on multi OS, which can simulate 'Windows Desktop' upto limited functionalities,
using Shell API, IContexMenu etc. With the help of CListCtrl (with Icon view) and CImageList, a Windows Desktop
has been prepared
For Context menu & PIDL, it works all fine on WIn XP,
however, on Win2k & Win98 whenever right-clicking onto non-iconic area (Desktop PIDL), my program raise error.
While debugging (& through logging), came to know that my code failed to find Desktop PIDL.
It failed at IShellFolder::GetUIObjectOf() in getting IContextMenu.
hr = m_pshObject->GetUIObjectOf (NULL, 1, (LPCITEMIDLIST *) m_pIDList, IID_IContextMenu, NULL, (void**) &InvokCmd);
Let me just elaborate through step-wise:
1). All these operation i'm performing onto 'my simulated Windows desktop'
2). To bring about the solution, hardcoding for the
Win98 desktop path C:\Windows\Desktop and for
Win2k C:\Documents and Settings\administrator\Desktop for conveting it into Desktop PIDL
Although after that, it could sucessfully displayed context-menu for desktop.
3). But when attempting to Copy-Paste operation, that is, copy any file/folder by Right-click on it,
and choose 'Paste' operation by right-click on desktop (my simulated Windows desktop),
my program performs bizarre behavior.
4). It made a new file/folder, and lable it 'Desktop' and for file-copying it shows with Windows default icon
5). One more thing, while tracing Log, analyzing for desktop PIDL i observed;
m_pIDList[0]- AppName: Desktop, AppFullPath: C:\Documents and Settings\Admin\Desktop\Desktop
in path, it shows desktop twice ...
i can't figure out how it behaves as such, while it performing nice on XP
Thanks a lot for help !
ab4rum
|
|
|
|
|
So...you supply the PIDL of the desktop folder and ask the desktop folder for the appropriate IContextMenu ?
The documentation describes the PIDL argument like this:
Address of an array of pointers to ITEMIDLIST structures, each of which uniquely identifies a file object or subfolder relative to the parent folder. Each item identifier list must contain exactly one SHITEMID structure followed by a terminating zero. Is the desktop folder a sub-folder of itself? No. I suspect that the fact it works on XP is coincidence - that or some extra checks they put in for errnous uses of the API like yours. The Windows 98/2000 behaviour kind of almost makes sense as well - the root namespace object is called 'Desktop'. You're copying something with the path 'Desktop\something' to the Desktop, so it creates a folder called Desktop as part of the paste process.
|
|
|
|
|
Sorry, i am not well at English.
My problem is that i don't know how to set sound output in left or right side of headphone.
I use portaudio class in my project to control sound output.
There is some parameters which i don't understand such as numOutputChannel.
I set it as 1 because 0 is no output.
When i set it as 2 and i set data (for output) at even point as 0, sound output in left side but sound output is different from i set numOutputChannel as 1.
Please tell me how to solve this problem.
If i set it as 2 that it is right way to control sound output in left side only, why sound output is differrent? and how to solve them?
|
|
|
|
|
nekokan wrote: When i set it as 2 and i set data (for output) at even point as 0, sound output in left side but sound output is different from i set numOutputChannel as 1.
Could you please rephrase?
- ns ami -
|
|
|
|
|
Can anyone tell me how to rename a vc++ project with its solution file.
I need step by step procedure.
Thanks in advance
|
|
|
|
|
What is it that you didn't understand in solutions provided yesterday.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
|
i tried this but its not working.
I followed following steps:
1)I installed vsrename.
2)I copied my project to that particular folder
3)then i cleaned sol file through clean all.
4)Then i used following command on command prompt:
C:\Documents and Settings\vsrename>vsrename oldfile newfile
Visual Studio Project Renamer v0.5 - Use with care!
Make backups before you use this program.
Do a 'Make Clean' on your original project before use.
Do a 'Rebuild All' on your renamed project.
By Niek Albers (nieka@daansystems.com)
Here we go:
/oldfile/: unmatched () in regexp at c:\vsrename\vsrename.pl li
ne 21.
This is coming.
And solution file is not renamed at all.
If you have another option please tell me
Thanks.....
|
|
|
|
|
why dont you try the GUI that is provided?? there is a link that is available in that site.
|
|
|
|
|
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 Friends,
My product has a feature of logging. Currently it is simple MACRO
based where during release build compiler removes logging function
calls. Now I am planning to make logging available during release
build as well. As a result user will simply pass some command line
parameter during process start and things will start logging.
Now as logging code will be present in my binary during release time,
this will enforce some types of checks even if the logging is not
enabled which will lead to CPU cost.
Is there any way to optimize these checks?
Are there any way where I can bypass these checks during normal
functional behavior.
Assembly, C, C++ compiler/code specific suggestions are welcome.
- Vikram S
|
|
|
|
|
If you write some generic logging function the type checking overhead is minimized. I use a global logging file, so there isnt a lot of stuff to do. Be careful if you do logging and multithreading!!
Greetings from Germany
|
|
|
|
|
vikrams wrote: Now as logging code will be present in my binary during release time,
this will enforce some types of checks even if the logging is not
enabled which will lead to CPU cost.
You mean you cant even check like this too?
if( bLogEnabled )
{
// code for logging...
}
- ns ami -
|
|
|
|
|
I can do this. But When there are hundreds of checks at runtime, will this be not an issue?
- Vikram S
|
|
|
|
|
AFAIK, this 'if' check will not bring any noticable change in the performance. I know even more complex logging mechanisms are used in professional softwares. Also you can avoid logs (if that much necessary) in some extremely performance oriented functions.
Note: You may simplyfy the code (only look) using by using macros, so that repeated if blocks can be avoided.
Eg.
#define LOG(x) if( bLogEnabled ) { LogString( x ); }
- ns ami -
|
|
|
|
|
i m developing msn protocol 15 in c++.but i faced a problem in contact management (in accept and accept & add scenario).
plz any one help.
|
|
|
|
|
Well, you have to fix the problem.
Okay, that's probably the most usefull answer we can give you seing how detailed your question was.
|
|
|
|
|
actually my problem is that when some one adding, than actual msn received a request and there is three option one is decline another one is accept with right click button and accept without right click button so on all the three process whats the actual msn doing on the server side i want that source code.
|
|
|
|
|
I really think you need to ask the Microsoft Guys for that.
|
|
|
|
|
Hi
I have the raw image and want to read it to do convolution. The image has 5 bytes header making all my code goes wrong. Could anyone suggest a way to read it.
The resolution for the image is 190 X 243, 8 bits and 5 bytes of header. Because I use
fopen and fread to open,read the file and I do not how to use pointer to modify the starting point of reading.
This is the image http://edventure.ntu.edu.sg/bbcswebdav/users/z050016/leaf.raw [^]
Thank you very much.
|
|
|
|
|
Use fseek to shift the file pointer.
Maxwell Chen
|
|
|
|
|
Hello to all,
I am using Visual C++ Express 2008, now I am trying to create an
DLL and use it next.
I think I do everything allright, compile the code. This code
creates a DLL file.
Next, I created code to use that DLL, after compile there is no errors.
During debug, it appears this error:
Unhandled exception at 0x00000000 in useDLL1.exe: 0xC0000005:
Access violation reading location 0x00000000.
In this moment, I don't know if the mistake is from the DLL file
or from the following code( it is for loads DLL ).
I need, and I appreciate some help to understand where is the problem.
----------------------------------------------------------------
#include <windows.h>
#include <iostream>
using namespace std;
typedef int (CALLBACK* DLLfunc)(int);
#pragma once
int main()
{
int i, result;
HINSTANCE loadFcn = LoadLibrary("createDLL1.dll");
// Check to see if the library was loaded successfully
if (loadFcn != 0)
cout << "\n *LoadMe library loaded!\n";
else
cout << "\n *LoadMe library failed to load!\n";
DLLfunc loadedFcn;
loadedFcn = (DLLfunc)GetProcAddress(loadFcn,"functeste");
result=loadedFcn(30);
//result = 10;
cout << "hello DLL" << endl << endl;
cout << loadedFcn;
cout << endl << result;
cin >> i;
return 0;
}
------------------------------------------------------------------------
|
|
|
|
|
You may try step by step debug to check each line.
- ns ami -
|
|
|
|
|
Hi,
I think GetProcAddress can't resolve the function address at your DLL.
Can you check your DLL if the function is exported from your DLL (e.g. with Depency Walker from VC, I'm not sure that it is included at the express version).
Is your DLL-func exported like
extern "C" __declspec(dllexport) int functeste(int i){....}
Take also a look to this article and my comment.
http://www.codeproject.com/KB/DLL/rsLoadtimeDLL.aspx?fid=29819&select=1269812&tid=1074998[^]
HTH
Frank
modified on Friday, February 20, 2009 2:06 AM
|
|
|
|
|
From GetProcAddress documentation [^]:
Return Value
If the function succeeds, the return value is the address of the exported function or variable.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
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]
|
|
|
|