|
Thanks for the info.
I assume my application needs to be a 'shell extension' COM object as I want my application to be integrate into all visible windows/applications without manually running anything. I'm new to that area of programming and from what I gather there is very little documentation (either that or I'm not using the right search keywords )
... can anyone offer any advice?
http://www.asura.co.uk
|
|
|
|
|
http://img115.imageshack.us/img115/2114/erroruq1.jpg[^] what is wrong with my aplication? when it runs on my pc everything is alright but when i try to run it on others PC's it gives an error like that above.
I am running on Windows XP SP2 while others i think on Windows XP no SP or SP1... but there is no difference between sp1 and sp2 at least for applications running, i think...
any ideas how to fix that? maybe compilator settings are wrong?
thank you in advance for help
|
|
|
|
|
Are you using manifest files? I had a similar problem some time ago when using them.
This[^] may be of some help to you.
|
|
|
|
|
|
if found that i need to install somewhat dll package to another PC... but thats useless at least in my case. I need standalone executable like Skype.exe and it doesn't matter how big it would be...
i didn't found anything useful about how to make standalone application. I have linked ATL libraries staticaly but thats not enought...
so how to make my application standalone?
|
|
|
|
|
you didn't answer my question. If you are using a manifest file, then you are forced to include the correct version of the dll's with your app. Try disabling the manifest.
|
|
|
|
|
ohh.. sorry if i disable the manifest then my application doesn't find MSVCR80D.dll
|
|
|
|
|
edvintas wrote: ...MSVCR80D.dll
There's the problem.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
edvintas wrote: I need standalone executable like Skype.exe and it doesn't matter how big it would be...
You'll need to staticly link to the CRT, to avoid having to redistribute the CRT DLLs with your app.
|
|
|
|
|
wow, it works
it is alive! :->
thanks... for advice
|
|
|
|
|
How can I get the keys of HKEY_CURRENT_USER? Are there any APIs?
Thank you?
modified 8-Mar-17 3:51am.
|
|
|
|
|
can you be a little more specific? You want to get a list of all the keys under HKEY_CURRENT_USER? Use the RegEnumKeyEx() in a loop increasing the dwIndex value each time. But make sure you do not make any changes to the registry within your loop. If you want to change any values, either store the key and do it after your loop, or break out then start looping again from the beginning.
|
|
|
|
|
|
I'm trying to implement a child window anchoring system into my window. My code works all well and good right up until the child window is resized to a point where it becomes invisible. This is the basic code I am using to calculate the new positions
::GetWindowRect(m_hWnd,&rcNew);
::OffsetRect(&rcNew,-rcNew.left,-rcNew.top);
::CopyRect(&rcOld,&m_rcWindow);
::OffsetRect(&rcOld,-rcOld.left,-rcOld.top);
int Xoffset = rcNew.right - rcOld.right;
int Yoffset = rcNew.bottom - rcOld.bottom; The value of rcNew is later stored.
Now heres the problem. For all child controls of the main window, it works. The new rectangle may contain negative figures which is no problem since it corrects itself when the window is again resized. But for the children of children an incorrect value is being assigned to the Xoffset and Yoffset values. I have traced this to the GetWindowRect() call. If a window is told to resize to a negative figure, it actually resizes to 0. Therefore GetWindowRect() returns a 0 width or 0 height. To do this correctly I need to somehow find the window rect as if it were inverted, ie a begative figure for the width or height. Any suggestions?
|
|
|
|
|
Not sure exactly how you're implementing your anchoring, but GetWindowRect get's the coordinates in screen coordinates, but the moving/sizing functions (MoveWindow, SetWindowPos, etc) work in client coordinates.
You can use ClientToScreen and ScreenToClient functions to translate between the two. If you move a parent window, the children will move also, since they're relative to the parent, so you shouldn't need to move the children of the children (but you will need to resize them).
This code will leave the child control at it's current x, y position, but adjust the child width based on the parent width:
::GetClientRect(m_hParentWnd, &rcParent);
::GetClientRect(m_hChildWnd, &rcChild);<br />
<br />
rcChild.right = rcParent.right - ( rcParent.right - rcChild.right );<br />
<br />
::MoveWindow( m_hChildWnd, rcChild.left, rcChild.top, rcChild.right - rcChild.left, rcChild.bottom - rcChild.top, TRUE );<br />
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Thanks for the reply but the code sample I gave is correct for what I am trying to do. I am specificaly using GetWindowRect() do to the extent of which I have customised the windows. GetClientRect() will no longer give a true reading. Also from my code you should see that I simply calculate the Xoffset and Yoffset then add or subtract this to the childs stored rectangle.
Since I posted the question I have managed to solve it. The first call to my function always comes from the main window, So I can pass in a NULL LPRECT forcing the function to call the GetWindowRect() api. Since this then calculates the new childrens position I can recurse the function passing in the newly calculated childs rectangle. This gives the added advantage of only needing to call the function once from the main window.
|
|
|
|
|
Glad you got it figured out!
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Hi,
I use dynamically created menus in my application where menu management becomes a complex task.
My problem is that when I get a CMenu pointer (CMenu* pMenu), how can I get the text and ID of the menu pointed by pMenu??
All menu APIs I saw so far deal with child menus, is there a way to get these information using this pointer?? My menu is a popup menu.
Thanks,
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
The CMenu::GetMenuItemID() and CMenu::GetMenuString() methods should help.
What exactly are you trying to obtain with the CMenu pointer?
Mark
|
|
|
|
|
those method did not help. what I am trying to do is as follows:
I use OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu) msg handler to update the childs of a popup menu item before they are displayed.
I need to know what menu item is exactly being updated, so I want either its ID or its text.
The methods you have posted are declared as follows:
UINT GetMenuItemID(int nPos )const;
int GetMenuString( UINT nIDItem, LPTSTR lpString, int nMaxCount, UINT nFlags ) const;
those deal with the childs of a popup menu item, not the menu item itself.
Any Ideas??
Thanks alot
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
The 1st level of the popup (the items you see first when it pops up) is pMenu->GetSubMenu(0).
So the top level items can be accessed like this:
pMenu->GetSubMenu(0)->GetMenuString(...)
If the third item (index 2) has a sub menu you could get at it like this:
pMenu->GetSubMenu(0)->GetSubMenu(2)->GetMenuString(...)
|
|
|
|
|
Maybe you have missunderstood me.
What I want is the ID/Name for the parent menu, not the childs!!
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Mohammad A Gdeisat wrote: What I want is the ID/Name for the parent menu, not the childs!!
ok sorry.
I don't see any functions or messages to get the parent menu from a child item.
Generally that's all known by whoever builds the menu.
You could start at the top with CWnd::GetMenu() or something and traverse the heirarchy I suppose.
|
|
|
|
|
Hello gurus,
I have a question concerning multi core programming.
I have written a simple independent thread encapsulated in a class that simply display a pixel at a random location and random color.
I can launch the thread on the CPU I want.
I have 4 x64 cores on my computer. So, when I saw the incredible speed I said to my self "ok, if it goes so fast on 1 CPU, it will go 4 time faster on 4 CPUs". So, I decided to create an array of my class that contains the thread and launch the thread on every CPUs with masks { 1, 2, 4, 8 }.
I noticed that it goes slower than it should!
Norally, as I launch 4 threads on 4 different CPUs, it can display simultaneously 4 pixel at a time, so it should give the illusion to go 4 time faster. But it is not the case.
My question is simply... WHY??? Why it goes slower than it should? What I have missed?
Thanks in advance for your answers.
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
bouli wrote: Norally, as I launch 4 threads on 4 different CPUs, it can display simultaneously 4 pixel at a time
You say normally it works but when you do it it's slower? Doesn't make sense.
There's no way it will be 4 times faster. It'll be faster but not a full 4 times. I know
close to nothing about the hardware involved, but I know the processors are sharing the same video
device, the same bus, etc. so it would be impossible to get 4 times the speed.
|
|
|
|