|
|
Thanx a lot
never say die
|
|
|
|
|
|
Hi everybody;
When I try to create a new project (c#,c++ etc.) on Microsoft Visual Studio Professional edition, I got this error message "Requested registry access is not allowed!" and creation of new project fails.
My OS is Windows Vista Home Basic. This problem appeared recently but I cannot fix it.
What can I do? Any suggestions?
Thanx everybody for reading...
|
|
|
|
|
Are you running VS as an administrator?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Yes my friend, I also try it!
I make a bit research in Registry for example under HKEY_CLASSES_ROOT some key start with ._sln* are not accessable. Maybe it is a clue?
|
|
|
|
|
Thanks for putting up with my many queries.
I have reached this stage:
// wn = the handle of the current window
#define OUCH MB_ICONEXCLAMATION
HDC dc=GetDC(wn); HDC dc2=CreateCompatibleDC(dc);
char t[256]; BITMAP bm;
.... // Here I set the elements of bm
sprintf(t,"%d: %d * %d, width = %d, %d planes, bpp = %d, pixels at %d",
bm.bmType,bm.bmWidth,bm.bmHeight,bm.bmWidthBytes,bm.bmPlanes,bm.bmBitsPixel,int(bm.bmBits));
MessageBox(0,t,"set up hbm",OUCH);
// This displays 0, 600, 600, 1800, 1, 24, 28180544 :: all correct as far as I can see;
// here 28180544 pointed to the pixel array of a valid image (a CGI image of two frogmen)
HBITMAP hbm=CreateBitmapIndirect(&bm);
BITMAP bm3; GetObject(hbm,sizeof(BITMAP),(void*)(&bm3));
sprintf(t,"bm3 is type %d, %d * %d, each row %d bytes, %d planes, bpp=%d, pixels at %d",
bm3.bmType,bm3.bmWidth,bm3.bmHeight,bm3.bmWidthBytes,bm3.bmPlanes,bm3.bmBitsPixel,int(bm3.bmBits)); MessageBox(0,t,"size",OUCH);
// This displays 0, 600, 600, 1800, 1, 24, 0
Please, what happened to my image's pixel array or its address?
|
|
|
|
|
You're only guaranteed to get a pointer to the pixel bits with a DIBSection.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
At last, thanks, it works, and I duly got my image back with "The quick brown fox jumps over the lazy dog." written on it, as a text run.
|
|
|
|
|
I am trying to cache icons but when I store the HICON, the second time around, I get no icon. I think I need to copy the data referred to by the HICON into my cache rather than store the actual handle. How would I copy the data?
|
|
|
|
|
I answered my own question, CopyIcon does the trick!
|
|
|
|
|
Hi.
I have created a console application which reads a file from the local disk and does certain operation on the data. where i need to specify the path of the file.
Now i have to create a dll file and i have to pass the path of the file as a parameter to the dll, But if i declare CString to hold the path it gives an error : undeclared identifier / no such directory of files found.
please help me asap.
|
|
|
|
|
did you include <afx.h>
and by the way you shouldn't be using a CString variable to be passed as a parameter. better use BSTR
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I tried using BSTR but it is giving error in header file. can anyone suggest the solution, its very urgent..
with regards
vinay
|
|
|
|
|
include 'comutil.h' and link to comsupp.lib to use BSTR's.
vinaykskvs wrote: its very urgent..
Should have resisted posting to this URGENT question but since I had already answered previously, had to follow this up.
Who suggested that you should be using CString variable to be used as a parameter while passing it to a different dll
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
change the property setting
give MFC shared dll ..
and then add afx .h header file ..
i think it ll work fine...
|
|
|
|
|
Are you even using MFC as others have assumed?
What version of Visual Studio? CStringT has been a template class
for a few versions of VC++. The appropriate header for a non-MFC
CString is atlstr.h.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
How can remove this error "An unhandled exception of type 'System.AccessViolationException' occurred in Test.exe
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
In my application is SDI type, i m use splitter here after using splitter in one view i m using a Treeview and in second view i m using a ListCtrl.
in List control for resizing i m using class ResizableFormView that is available on codeproject.
in list control on PreTranslateMessage(MSG* pMsg) function i m using this coding
CListCtrl m_list;
switch(pMsg->message)
{
case WM_KEYDOWN:
{
if (VK_RETURN == (INT)pMsg->wParam && ::GetFocus() == m_list.GetSafeHwnd())
{
int nIndex = m_list.GetNextItem(-1, LVNI_SELECTED);
CString strItem = m_list.GetItemText(nIndex, 0);
//open any dilog box here
}
}
}
return CResizableFormView::PreTranslateMessage(pMsg);//error occured here
for handle enter key on ListCtrl.
this function is done properly but after this the error is coming"An unhandled exception of type 'System.AccessViolationException' occurred in Test.exe"
please tell me what can i do for this.
thank in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
By using your debugger to see exactly what is happening. This can happen for a thousand of different reasons, so we can't provide any universal magical solution.
|
|
|
|
|
In my application is SDI type, i m use splitter here after using splitter in one view i m using a Treeview and in second view i m using a ListCtrl.
in List control for resizing i m using class ResizableFormView that is available on codeproject.
in list control on PreTranslateMessage(MSG* pMsg) function i m using this coding
<br />
CListCtrl m_list;<br />
switch(pMsg->message) <br />
{<br />
case WM_KEYDOWN:<br />
{<br />
if (VK_RETURN == (INT)pMsg->wParam && ::GetFocus() == m_list.GetSafeHwnd()) <br />
{<br />
<br />
int nIndex = m_list.GetNextItem(-1, LVNI_SELECTED);<br />
CString strItem = m_list.GetItemText(nIndex, 0);<br />
<br />
<br />
<br />
}<br />
}<br />
}<br />
return CResizableFormView::PreTranslateMessage(pMsg);<br />
for handle enter key on ListCtrl.
this function is done properly but after this the error is coming"An unhandled exception of type 'System.AccessViolationException' occurred in Test.exe"
please tell me what can i do for this.
thank in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Did you read my previous reply ?
Where does your code crashes exactly ? Use the call stack if necerssary (if the crash doesn't occur in your code).
|
|
|
|
|
Hi,
I'm searching for C++ classes (MFC) gathering media infos in
JPG,GIF,BMP,PDF,MP3,MP4, etc...
To make it clear, I don't want to display or modify the files,
I'm simply interested in lightweight and fast routines to get the basic infos
like width/height/colors in images or number of pages in PDFs
(somewhat like the properties tab in Windows' Explorer).
I don't need big and high sophisticated projects with
hundreds of whistles and bells...
I remember there are books about file "standards" and formats
but I don't really want to reinvent the wheel and start from
scratch.
I'm now searching for days, but all things I found are to complex.
Don't let me be misunderstood, they're all great and kudos to the authors
but for the purpose I'd like to use somewhat 'over-dozed'.
If I succeed I'll make a article with the results, so the routines should
be free of royalties.
Could someone please give me a hint or lead me to some links?
greetings,
ralf.
|
|
|
|
|
I have a VC++ app that uses a progress dialog that contains a CProgressCtrl to indicate progress of a task. When the app kicks of a task, this dialog is launched as a modal dialog and progress of the task is indicated by the CProgressCtrl.
Issue
-----
For tasks that take extended period of time, the progress dialog blanks out (becomes a blank white rectangle) as soon as user selects a different app. But the processing continues as usual. The dialog is closed when the task is completed. Users are getting confused by this behavior since they are not sure if the app went into an infinite loop or is processing normally since there is no indication of progress in the dialog. They just have to give it time or kill it.
I am trying to figure out how to maintain the progress indication in this dialog irrespective of user switching apps. Any suggestions are very much appreciated.
So far, I tried the following, based on posts in this board, without success.
1. Force the dialog to stay on top of all windows in the desktop by including the following statement in OnInitDialog
SetWindowPos(&this->wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
2. Calling a Refresh function in the dialog, containing the following statements, periodically during the progression of the task
SetForegroundWindow();
SetFocus();
|
|
|
|
|
|
Thank you for the link but it does not solve my issue.
|
|
|
|
|