|
We have several cases where the Matlab-Version is not significantly slower than the C++-Version. Plus Matlab is easier developed.
You seem to have hit a point where recoding the algorithm in C++ gives real benefits.
But in our hands, whe had cases where the algos from 'numerical recipts" were actually slower.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Hi,
I am using VS 2005 on vista platform.
I want to set a registry entry located in HKEY_LOCAL_MACHINE.
The following function fails.
RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"System\\CurrentControlSet\\Control\\Windows",
0,
KEY_SET_VALUE,
&hKey);
The return value of the above API is ERROR_ACCESS_DENIED.
I have logged in as an normal user without any admin privilages.
I know this funciton is failing because I donot have the privilage to perform any write operation.
How do I get around this problem without having Admin privileges?
I want to modify registry value located in HKEY_LOCAL_MACHINE.
Could anybody help me with this issue?
|
|
|
|
|
I think that it is not possilbe ...you need Admin privileges (that is the reason why Admin exist)
Russell
|
|
|
|
|
U will have to execute ur application as "Run as Adminstrator".
Sachin
|
|
|
|
|
Marimuthu.pesit wrote: How do I get around this problem without having Admin privileges?
Temporarily turn off UAC.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Normaly, you set the needed Keys in HKEY_LOCAL_MACHINE at installation time.
Programms write deviations from the defaults to HKEY_CURRENT_USER. That is writable without privileges.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
hi all
can anybody send me vc++ questions with mfc for interview
i go for one year experience in vc++
so please send me some questions which really help me
thanks
|
|
|
|
|
Hai,
I wish you all the best for getting a good job. Mostly questions are coming from C++, MFC basics, Doc/View architecture,controls, threading etc. So, concentrate on more on this. so that you can survive.
Wish you good luck.
|
|
|
|
|
thanks a lot sir
but can i get some sample questions please
|
|
|
|
|
like serialization, messagemaps, RTTI, Frames, dialogs, views, documents, DLL's, Threading concepts. You can easily downloaded from net. otherwise buy a book for interview questions. lot of books are available in roadsided or other book shops.
|
|
|
|
|
Dear friends
I want to write a program in such a way that,if any body tries to access my folder say E:\\chandu i should get an indication to my hidden program.
thanks in advance.
|
|
|
|
|
Have to go for some filter driver like "Filemon"
|
|
|
|
|
i want to know how can i can the api of some executable or better some component of windows.... i want to host some of the windows component in my mfc application... how can this be done...
tHeStRaT
|
|
|
|
|
thestrat wrote: i want to host some of the windows component in my mfc application
For showing most of the windows components there are functions. For eg to create a new network connection you have to call the HomeNetWizardRunDll() function in the hnetwiz.dll. What i did to find this function is that. Take the windows help, search for "Network Setup Wizard". In some results you will find a link to "Network Setup Wizard" right click on it and take properties. then you can find the dll name and the function of it. like..
ms-its:C:\WINDOWS\Help\network.chm::/EXEC=,rundll32.exe,hnetwiz.dll HomeNetWizardRunDll
hope this helps...
|
|
|
|
|
Hello All,
I have the source code of a dll and i am supposed to re-write it.
This dll uses COM. (It has COM Interfaces and will invoke a COM exe as well).
Now, looking at the source code, how can i figure out the project settings with which it was created ?
These are some of the details which i want,
* Is it a ATL COM AppWizard or MFC AppWizard dll.
* If ATL COM AppWizard, is it been developed with MFC Support or not ?
* If MFC AppWizard dll, is it a Regular Dll with MFC Statically Linked or Regular Dll using shared MFC dll or MFC Extension Dll ?
How do i get these information from the source code ?
Thanks
|
|
|
|
|
Hi,
If dll uses COM component than it is ATL Com appwizard and when u create new workspace than option of MFC support is also displayed. u may select MFC support and than create workspace
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
user3034 wrote: Now, looking at the source code, how can i figure out the project settings with which it was created
If by "source code," you strictly mean the cpp and h files, you can't. You need the project file, which, IMHO, is part of the source code, just like Makefiles back in the old days. For VC 6, you're looking for the .dsw / .dsp file; for 2005, the .sln / .vcprog
Judy
|
|
|
|
|
Hi,
Using VC++, MFC How to Create Activex and Talk with C#? Any Idea..Reply Me..
Any tutorial For VC++(MFC)??
|
|
|
|
|
In VC++ 6.0 you will find an ActiveX control wizard from there you can create any sort of AX u want.
try this out and get back to me I shall guide u.
|
|
|
|
|
See such code:
[1]: std::string *strTemps=new std::string[2];
[2]: delete strTemps;
it would crash at the line [2].But if I chang the code like bellow:
[1]: std::string *strTemps=new std::string[2];
[2]: delete [] strTemps;
It will work will now.
Someone would like to tell me, why?
Thanks.
GOOD LUCK.
|
|
|
|
|
If you allocate an array with new, then you should deallocate an array also. When you use new[], some information will be put in front of your pointer to hold the number of elements you allocate. So, you really need to match new with delete and new[] with delete[], otherwise you'll get a crash.
|
|
|
|
|
I agree what you said.
But this code:
struct T{
int m;
int n;
};
[1] int* int_array=new int[4];
[2] delete int_array;
[3] struct T *t=new T[4];
[4] delete t;
The code will work well.
Why,now?
Thank you.
|
|
|
|
|
Because you are just being lucky . It is not because it doesn't crash that your code is correct. You will probably have some memory leak also: the delete expect to free only one element, so, only the space for one element will be deallocated, resulting in a memory leak.
|
|
|
|
|
I hope so.
And I will follow your guideline in future.
Thank you very.
Have a good day.
|
|
|
|
|
I have done an untitled dialog box in MFC,
Clicking on this dialog button on taskbar, window does not minimize or maximize.
To handle this i have written code in OnNcActivate message.
My problem is that, when i say ShowWindow(SW_SHOWNORMAL); at that time the window
is shown but again it gets minimized. It does not get hold.
Please try the code, let me know what is the problem.
Here is the following code
BOOL CRestoreDlg::OnNcActivate(BOOL bActive)
{
BOOL b2 = FALSE;
TBBUTTON tbButton;
HWND hWndBut = NULL;
WINDOWPLACEMENT wndpl;
HANDLE hProcess = NULL;
LPVOID lpRemoteBuffer = NULL;
DWORD dwProcessId = 0, dwThreadId = 0;
memset(&wndpl, 0, sizeof(WINDOWPLACEMENT));
memset(&tbButton, 0, sizeof(TBBUTTON));
GetWindowPlacement(&wndpl);
HWND hDesktop = ::GetDesktopWindow();
HWND hTray = ::FindWindowEx(hDesktop , 0, _T("Shell_TrayWnd"), NULL);
HWND hReBar = ::FindWindowEx(hTray, 0, _T("ReBarWindow32"), NULL);
HWND hTask = ::FindWindowEx(hReBar, 0, _T("MSTaskSwWClass"), NULL);
HWND hToolbar = ::FindWindowEx(hTask, 0, _T("ToolbarWindow32") , NULL);
LRESULT count = ::SendMessage(hToolbar, TB_BUTTONCOUNT, 0, 0);
dwThreadId = GetWindowThreadProcessId(hToolbar, &dwProcessId);
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcessId);
if (NULL == hProcess)
{
return FALSE;
}
for (int i= 0 ; i < count ; i++ )
{
memset(&tbButton, 0, sizeof(TBBUTTON));
lpRemoteBuffer = VirtualAllocEx(hProcess, NULL, sizeof(TBBUTTON), MEM_COMMIT, PAGE_READWRITE);
if (NULL == lpRemoteBuffer)
{
return FALSE;
}
::SendMessage(hToolbar, TB_GETBUTTON, i, (LPARAM)lpRemoteBuffer);
b2 = ReadProcessMemory(
hProcess,
lpRemoteBuffer,
(LPVOID)&tbButton,
sizeof(TBBUTTON),
NULL);
if (FALSE == b2)
{
return FALSE;
}
BYTE localBuffer[BUFFER_SIZE];
BYTE* pLocalBuffer = localBuffer;
DWORD_PTR ipLocalBuffer = (DWORD_PTR)pLocalBuffer;
pLocalBuffer = localBuffer;
ipLocalBuffer = (DWORD_PTR)pLocalBuffer;
DWORD_PTR lpRemoteData = (DWORD_PTR)tbButton.dwData;
ReadProcessMemory(hProcess, (LPVOID)lpRemoteData, (LPVOID)ipLocalBuffer, sizeof(DWORD_PTR), NULL);
HWND windowHandle;
memcpy(&windowHandle, (void *)ipLocalBuffer, 4);
if (windowHandle == m_hWnd)
{
if (tbButton.fsState & TBSTATE_PRESSED)
{
if (wndpl.showCmd == SW_SHOWMINIMIZED)
{
ShowWindow(SW_SHOWNORMAL);
}
else if (wndpl.showCmd == SW_SHOWNORMAL)
{
ShowWindow(SW_SHOWMINIMIZED);
}
}
}
VirtualFreeEx(hProcess, lpRemoteBuffer, 0, MEM_RELEASE);
}
CloseHandle(hProcess);
return TRUE;
}
|
|
|
|
|