|
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.
|
|
|
|
|
I guess your application is single threaded and that is the problem. Once you enter in a function which takes long time GUI cannot be updated since there is only one thread and it is busy in the expensive function. The solution is to create another thread and do the processing in that thread.
-Saurabh
|
|
|
|
|
Thank you.
Can you refer to any topics in this board that would help triggering my functions in a different thread. I have not done any multi-threaded apps as yet.
|
|
|
|
|
Hi Experts
How can i read and write data from USB.Plz help me..
|
|
|
|
|
You don't do that directly. You have to communicate with one of the device sitting on the bus through its device driver, and you can't access the bus directly. Which device are you trying to communicate with ?
The way to go is to get a handle to the driver through CreateFile (you simply the device symbolic name) and then you can call ReadFile and WriteFile or exchange specific control codes by calling DeviceIOControl. All of those things are specific to the device you try to communicate with, so you need to have some documentation.
|
|
|
|
|
Thx's for reply can you give document or example code.If it is possible(document or code) then plz give me..
Thx's
|
|
|
|
|
No I can't because it is specific to the device you are trying to access. So, please answer my question: which device are you trying to communicate with ?
Normally, you should have some documentation supplied with the device.
|
|
|
|
|
ok iwant to access all device but first i want to access PenDrive.So plz help me
|
|
|
|
|
mirtu wrote: ok iwant to access all device
Why do you want to do that ? What do you want to do with those devices if you don't know how to communicate with them ?
mirtu wrote: but first i want to access PenDrive
You can simply access the files the standard way. The driver takes care of everything. The only thing a bit more tricky would be to know which driver letter is used by the device, but I don't know exactly how to do that. I guess you should check somewhere in the registry.
|
|
|
|