|
buki86 wrote: i implemented it as shown below and also did a manual calculation using coeffiecients and the answers do not match at all.instead of reducing the amplitude, its the other way round.
So have you stepped through the code using the debugger to see what the values are?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi,
I have created a dialog based application in visual studio 2010 and I have added a CSplitButton Control to my dialog through resource editor, also I have made a menu in resource editorwith the ID of IDR_MENU_BUTTON_FILE and a sud menu after all, my code looks like the following code:
BOOL CMyDialogDlg::OnInitDialog()
{
CSplitButton* pCtrlSpiltBtn = (CSplitButton*)this->GetDlgItem(IDC_SPLITBUTTON1);
pCtrlSpiltBtn ->SetDropDownMenu(IDR_MENU_BUTTON_FILE, 0);
}
however the pCtrlSpiltBtn get initialized correctly and every thing is OK. but
pCtrlSpiltBtn ->SetDropDownMenu(IDR_MENU_BUTTON_FILE, 0);
fails when I trace the case I found that this line call the following methods of MFC classes.
void CSplitButton::SetDropDownMenu(UINT nMenuId, UINT nSubMenuId)
{
Cleanup();
m_nMenuId = nMenuId;
m_nSubMenuId = nSubMenuId;
}
void CSplitButton::SetDropDownMenu(CMenu* pMenu)
{
Cleanup();
m_pMenu = pMenu;
}
void CSplitButton::Cleanup()
{
if (m_pMenu)
{
delete m_pMenu;
}
m_pMenu = NULL;
m_nMenuId = (UINT)-1;
m_nSubMenuId = (UINT)-1;
}
and the m_pMenu pointer is always initialized and while the line
delete m_pMenu;
get executed all the application ruining fails.
Please help me solve the case, what should I do?
|
|
|
|
|
Hello Sir
Currently i have create the pdf document from JPEG images , i have create the pdf document is successfully my question is ,
when i was create the pdf document margin is same , but i need to create separate margin , i dont know how to do that ?
please help me sirs
this is my JPEG2PDF file
Failure is Success If we learn from it!!
modified on Wednesday, April 28, 2010 2:02 PM
|
|
|
|
|
Game-point wrote: ...but i need to create separate margin...
A separate margin? Separate from what?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
thanks for your replay ..i solved it
Failure is Success If we learn from it!!
|
|
|
|
|
hi
i want to run an dshow an application in my project and limit it to my MDI form !
can i do it? if yes how can i?
|
|
|
|
|
you want an application to run inside your application ?
does this help[^]?
|
|
|
|
|
I think you should write hWnd of MDI form in dshow owner device.
|
|
|
|
|
There is a 3rd lib only accept char* filename e.g.
3rdlib_func_name(char* file_name) . Every things get wrong when I provide a filename in Chinese or Japanese.
Is there any way to make this lib open UNICODE filename? The program is running on Windows.
Thanks for your reply.
A Chinese VC++ programmer
|
|
|
|
|
zengkun100 wrote: Is there any way to make this lib open UNICODE filename?
Only by changing its source code. You will have to go to the suppliers of the library to get it changed if you do not have the source.
It's time for a new signature.
|
|
|
|
|
Richard MacCutchan wrote: Only by changing its source code. You will have to go to the suppliers of the library to get it changed if you do not have the source.
I think so.
In theory, char* cant only be used to point to a UTF8 UNICODE string, however, you cannot give a UTF8 filename to fopen or some other file functions. But if I transfer this UNICODE filename to char* using CP_ACP, some of the characters cannot be changed.
A Chinese VC++ programmer
|
|
|
|
|
Exactly right, which is why all software suppliers should be providing full Unicode support. I think you need to talk to the supplier of the library and get them to change it. You may also note that _wfopen is the Unicode version of the file open function, so there is no problem with Unicode file names.
It's time for a new signature.
|
|
|
|
|
Thanks for your reply again We have called our partner this afternoon.
A Chinese VC++ programmer
|
|
|
|
|
If your app is UNICODE!
Their is a function to change UNICODE string to CHAR!
wcstombs[^]
But I guess that won't fix it either if your filenames are in UNICODE.
|
|
|
|
|
Fareed Rizkalla wrote: If your app is UNICODE!
Their is a function to change UNICODE string to CHAR!
wcstombs[^]
But I guess that won't fix it either if your filenames are in UNICODE.
Yes, even if I transferred the UNICODE filename to a char*(using CP_ACP or CP_UTF8), the 3rd lib don't accept this filename and returns a "file not found" error code.
A Chinese VC++ programmer
|
|
|
|
|
Has anyone SetHotKeys before for a IShellItem!
I did setup a HotKey through
RegisterHotKey (g_hWindow, 0, MOD_CONTROL | MOD_NOREPEAT, 0x4E);
It works fine, but I want to use the IShellItem to hookup to the same HotKey.
Seen some examples using HOTKEYF_CONTROL instead MOD_CONTROL, which is it!
Some people confuse the HIWORD instead of the LOWORD, if anybody knows any solid details please help!
Thanks in advance.
|
|
|
|
|
Using visual studio 2008 I created a small vc++ project and ran it using the exe created.
The problem is the exe runs fine on my PC.
But when I tried to run the exe on an another PC it gave the error "The application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."
Any idea as to what may be causing this error and how to resolve it?
|
|
|
|
|
You have to install the VC2008 redistributable package (search on the MSDN website) on the target PC. This will install the MFC and C run-time libraries which are required by your application.
Another solution is to statically link against those libraries.
|
|
|
|
|
Thanks Cedric for the inputs.
Anyway I solved the issue by changing the project configuration.
In the Project Properties >>> C/C++ Code Generation >>> Run Time Library I selected /MT which solved the problem. Earlier it was /MD which which was causing the error.
|
|
|
|
|
Yes, it means you statically link against the run-time libraries as I said in my previous reply.
|
|
|
|
|
yes thanks for the hints.
|
|
|
|
|
Hello people!
In a "home project" i tried to inject a DLL into explorer's process with the "CreateRemoteThread" and the "Hook" method. Both seems to work fine for other processes (tried with notepad.exe, tried with a simple test app of my own...) but if i try to use explorer's process...major FAIL. The "CreateRemoteThread" method causes an instant reboot of the system. If i try to use the other method i either get "access denied" when trying to install a hook using SetWindowsHookEx into explorer's GUI thread, or if i install a global hook it simply does not get called for explorer only for other processes. With both methods i have enabled the "debug" privilege on "my own" process' access token.
So my question is simply this: does the system no longer allow DLL injecting into explorer? I googled around and i have found many references of this being possible, i mean, to inject DLLs to explorer with both methods, however, i did not find anything conclusive about this no longer being allowed, and since the articles that say it is possible are mostly rather old, things might have changed since then (new Service Packs came out, new patches for XP, and so on...). I checked my code against examples i have found online but i see no major differences, and i supose if the code itself was bad then it would not work for other processes either. I tried this on XP Pro SP3 if it matters.
Thanks for any hints in advance.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
modified on Wednesday, April 28, 2010 10:55 AM
|
|
|
|
|
Hi,
Code-o-mat wrote: The "CreateRemoteThread" method causes an instant reboot of the system.
I assure you that this is not normal. It sounds to me that you have a rogue security product or perhaps malware causing the reboot. I would recommend debugging the cause. Upon reboot a dump file should have been written into the %SYSTEMROOT%\windows\minidump folder.
I would recommend following the instructions here to determine the cause of the reboot.
How to read the small memory dump files that Windows creates for debugging[^]
Code-o-mat wrote: So my question is simply this: does the system no longer allow DLL injecting into explorer?
Yes you should be able to inject a DLL into the explorer process. Without looking at your code I cannot determine why it is failing.
Best Wishes,
-David Delaune
|
|
|
|
|
Hey!
Thanks for your words. Seems to be that the cause of the reboot is something else than i originally thought. When i tried the "windows hook" method and got the "access denied" message i assumed that it must be some security issue. I also tired the "code-cave" method on notepad and windows detected it and "shut down notepad to protect my security", this also streanghtened my assumption that it is somekind of "protect the user" mechanism. But after your post i started experimenting some more with the "Remote thread" method and i actually got the DLL into explorer, i also determined that the reboot comes when i try to use certain methods in the DLL, i also experienced deadlocks. For example, in the DLL i create a new thread which then would call "GetDesktopWindow" to get the handle of the desktop window but the thread seems to deadlock in this method, it never returns from it.
At this point i am clueless why this happens, if you have any pointers, please share. Thanks.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hi all!
I meet a problem when I derive a class from CEdit. I want to use a font specficed by myself in it. Now I use the font in the message function of WM_CTLCOLOR in parent window of CEdit. The new font can be shown in CEdit. But when I double click the left-button or drag the mouse to select more than one character, the position of caret is wrong. I don't know how to fix it. Plz help me! Thx!
whiteclouds
There is some white cloud floating on the blue sky. That's the landscape I like.
|
|
|
|