|
1. I have tried removing everything from the callback function except return true; , and when i do that the messagebox doesn't appear, but in the Debug fan (the one where there's Build, Debug, Find In Files 1 etc.) it says
First-chance exception in MP3.exe (MSACM32.DLL): 0xC0000005: Access Violation.
First-chance exception in MP3.exe (MSACM32.DLL): 0xC0000005: Access Violation.
(yes, the statement is shown twice)
2. The line where i call the function that uses the callback function is as follows:
acmDriverEnum(listCallback, NULL, ACM_DRIVERENUMF_DISABLED);
The prototype of the callback is:
BOOL WINAPI listCallback (HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport); but that is actually not the original callback function definition, it's like this:
BOOL ACMDRIVERENUMCB acmDriverEnumCallback(HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport); the reason i changed it was that it wouldn't compile when i used ACMDRIVERENUMCB, a lot of compile errors showed. so i asked what could be wrong and one said that maby ACMDRIVERENUMCB was just a typedef of WINAPI so i used that, could that be where the problem lies?
Thanks for your help.
|
|
|
|
|
redeemer wrote:
the reason i changed it was that it wouldn't compile when i used ACMDRIVERENUMCB, a lot of compile errors showed. so i asked what could be wrong and one said that maby ACMDRIVERENUMCB was just a typedef of WINAPI so i used that, could that be where the problem lies?
I doubt it. (Maybe this is just because it was me who suggested you to change it . However, I never said is a typdef for WINAPI, but it is a typedef for the pointer to listCallback. Take a look at the definition of ACMDRIVERENUMCB in the header file. The docs are just wrong here.)
However, back to your problem: It works if you remove all code from your listCallback. Therefore it is probable (but not sure...) that the problem is caused by that code. (The exception messages you get are no problem. If the debugger does not claim about an unhandled exception they are catched inside MSACM32.DLL - nothing you should worry about.)
Next step: Trackle it down. If it fails because of that code, check which part of the code (especially the calls to acmDriverDetails() and/or SendMessage()) causes the problem. (Don't forget to pass a valid string in SendMessage() if you remove the call to acmDriverDetails()!)
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Hi!
I want to get the text of a button from another app.
Usually I use SendMessage with WM_GETTEXT to get the text. But this time it doesn't work because the button has a bitmap AND a caption.
Even Spy++ can't get the text of the button.
It seems like the caption is being drawn at runtime onto the button
Does anyone know a solution?
thanks in advance
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Sorry - there's nothing you can do about owner-drawn button which doesn't use Get/SetWindowText for its caption.
What kind of application are you developing?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
I simply want to find out what online status (Online, Invisible, Away, ...) ICQ currently has without utilizing the ICQAPI from Mirabilis. But I didn't find a way yet exept taking a look at the button which has the current status as its caption.
But it is owner drawn
modified 12-Sep-18 21:01pm.
|
|
|
|
|
1)How can i convert _variant_t to std::string ??
2)How can i convert _variant_t to char * ??
|
|
|
|
|
_variant_t v(_T("Test string"));
std:string s = (LPCTSTR)(_bstr_t)v;
printf(s.c_str()); // const char *
Concussus surgo.
When struck I rise.
|
|
|
|
|
Occasionally I need to send out debug versions of my apps - I keep hold of the EXE so when I receive a Dr Watson log, I can run the EXE, attach using MSDEV, break in and jump straight to the source of the problem. Also, I used to use a tool called BugTrapper that required you ship your app with debug info, etc. Anyway, I digress. The problem is that with one application, the debug EXE is ENORMOUS!
Here is how I created the project:
* First I used the MSDEV Build|Configurations option to create a new build called Release Unstripped which is based on the normal Release build.
* I then changed the project settings for the Release Unstripped build in just two places:
From the C/C++ tab, I set Debug Info to Program Database.
From the Link tab I enable Generate debug info.
When I then do a full build of the Release, Debug and Release Unstripped versions I get the following sized EXEs:
Release: 3MB
Debug: 9MB
Release Unstripped: 18MB
How the heck can the size difference be so huge?? What am I missing? There must be a project setting I have missed??
Immerse your soul in love.
|
|
|
|
|
Maybe you're statically linking to MFC and other libraries...
Concussus surgo.
When struck I rise.
|
|
|
|
|
I am statically linking with MFC for all builds - including the normal debug one. I don't see why my hybrid release/debug version should be double the size of the debug one. I have other statically linked apps that don't exhibit this problem, so there must be something I have missed in the project settings...
Faith. Believing in something you *know* isn't true.
|
|
|
|
|
Check the resulting executables with dumpbin.exe. At least you'll know what exactly causes the release unstripped to be that large.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
hello,
i want to convert texts to bitmaps. the text's font , size
and other font attributes will be given . the program will
convert the text to bitmap. please help me with necessary code and their explanation.
my e-mail address is
smshahed@yahoo.com
and
nejhum@bttb.net.bd
thank you ,
sm shahed nejhum
|
|
|
|
|
|
In windows you can close a dialog with the x-button on the top-right corner or you press alt-F4.
But, if you start a dialog based application, the dialog also closes when you press enter or escape (ok or cancel).
Can I disable this standard behaviour?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
override PreTranslateMessage
then add this code:
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
// Don't let CDialog process the Escape key.
if ((pMsg->message == WM_KEYDOWN) && ((pMsg->wParam == VK_ESCAPE) || (pMsg->wParam == VK_ENTER))
{
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
tnx, it works.
VK_ESCAPE is defined somewhere, but VK_ENTER isn't. any headerfile to include? or is it VK_RETURN?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Have a look at this [msdn page][^] to answer your question
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|
|
yeah, VK_RETURN
-c
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
And let's say there's another control in the dialog, one that needs the enter-key (ex. TreeCtrl in editlabel mode).
if we override the pretranslatemessage like you showed above, we have to manualy take care of all that. Or am I wrong?
we can't dispatch it to the CDialog::PreTranslateMessage member, cause the enter key will close the dialog.
A member like CDialog::SetAutoClose(TRUE/FALSE) doesn't exits, is it?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
here's how i handle it in http://www.codeproject.com/property/saprefs.asp[^].
BOOL CSAPrefsSubDlg::PreTranslateMessage(MSG* pMsg)
{
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_ESCAPE))
{
GetParent()->PostMessage(WM_CLOSE);
return TRUE;
}
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_RETURN))
{
TCHAR szClass[10];
CWnd* pWndFocus = GetFocus();
if (((pWndFocus = GetFocus()) != NULL) &&
IsChild(pWndFocus) &&
(pWndFocus->GetStyle() & ES_WANTRETURN) &&
GetClassName(pWndFocus->m_hWnd, szClass, 10) &&
(lstrcmpi(szClass, _T("EDIT")) == 0))
{
pWndFocus->SendMessage(WM_CHAR, pMsg->wParam, pMsg->lParam);
return TRUE;
}
return FALSE;
}
return CDialog::PreTranslateMessage(pMsg);
}
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
some more comments. This is what I just read today:
The following keys are active in a dialog:
...
Enter: Press the button if the focus is on a button. Otherwise it presses the default button. One button in a dialog can be given the BS_DEFPUSHBUTTON style. If no button is the default, Enter generates WM_COMMAND with IDOK.
Esc: Generates WM_COMMAND with IDCANCEL.
So in your case, you need to overwrite the virtual function OnOK and OnCancel.
|
|
|
|
|
Allright,
deprecating OnOK and OnCancel works
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
I tried to do this:
GetListCtrl().SetItemState( j,LVIS_SELECTED|LVIS_FOCUSED , LVIS_SELECTED|LVIS_FOCUSED );
But there is no any changing in my CListView derivied class.
|
|
|
|
|
hi,
i have these values in demo.txt:-
1
2
3
4
5
6
7
8
9
when i do
//...
ifstream file("demo.txt");
while(!file.eof())
{
int nValue = 0;
file>>value;
values.push_back(nValue);//some vector
}
file.close();
//...
i get the last number 9 read twice;Why?
|
|
|
|
|
here you go.. this should work.. I think...
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
void main()
{
vector<int> values;
ifstream file("demo.txt");
while(!file.eof())
{
int nValue = 0;
file>>nValue;
values.push_back(nValue);
cout << nValue << endl;
}
file.close();
}
well.. I'm assuming it will. Oh.. and sometimes have a new line at teh end of a file will give you an arbitary value.. SO don't put in a new line at eh end.
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|