|
Add comsupp.lib in the linker tab of project settings dialog.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
On
Project/Properties/Linker/Input/Additional dependencies
I added comsupp.lib but the same error persists
Actually, I am brand new to VS.NET, so I might be wrong.
R.
|
|
|
|
|
Have no idea where can you set the libraries in VS.NET - I'm still using VC6. Look for a field with number of other .libs, like kernel32.lib.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Originally I successfully compiled this code with the .NET default settings, among others with the default char set MBCS. Then I played with the settings, switched to UNICODE, after which I got a ton of linker errors, and then returned to MBCS. And these two errors came.
I have no idea...
R.
|
|
|
|
|
I want to display the 2 fields of all records in a table in listbox.
my program is crshing. i dont know why. can someone help me?
here is the code snippets..
BOOL CMgen1Doc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
if(m_mgen1Set == NULL) {
m_mgen1Set = new CMgen1Set(&m_database);
CString strConnect = m_mgen1Set->GetDefaultConnect();
m_database.Open(NULL, FALSE, FALSE, strConnect, FALSE);
}
return TRUE;
}
void CMgen1View::OnInitialUpdate()
{
m_pSet = GetDocument()->m_mgen1Set;
CRecordView::OnInitialUpdate();
LoadListbox();
}
void CMgen1View::LoadListbox()
{
CMgen1Doc* pDoc = GetDocument();
CListBox* pLB = (CListBox*) GetDlgItem(IDC_LIST1);
CMgen1Set sect(&pDoc->m_database);
sect.Open();
while(!sect.IsEOF()) {
pLB->AddString(sect.m_CourseID + " " + sect.m_SectionNo);
sect.MoveNext();
}
}
|
|
|
|
|
Usual questions:
What do you mean by crashing? (e.g. Asserting in DEBUG mode, Gets Access violation etc.)
Where is the program crashing? (Stepping through your code, what line is it executing when it "crashes"
Are there any error indications? (ASSERT dialog, TRACE output, GPF dialog etc.)
I don't see anything wrong with the code you presented off hand, but I won't look at it very closely until I know what I am looking for.
|
|
|
|
|
This is the message in the box:
This program has performed an illegal operation and will be shutdown.
If the problem persists contact the vendor.
If I click the Details button i see the following msg:
MGEN1 caused an invalid page fault in
module <unknown> at 00f9:000615c9.
When I step through the code, I am getting an 'Unhandled exception' in this CRecordView::OnInitialUpdate(); line of code.
void CMgen1View::OnInitialUpdate()
{
m_pSet = GetDocument()->m_mgen1Set;
CRecordView::OnInitialUpdate();
LoadListbox();
}
|
|
|
|
|
Hello!
You cannot call the 'GetDocument()' function of a view before you call 'CRecordView::OnInitialUpdate()'. Your program crashes because GetDocument() does not know what to return.
Let me quickly explain. The CRecordView::OnInitialUpdate function hooks your view into the document, so that you can always retreive the associated document with GetDocument(). If you try and call GetDocument() before that, it will probably return NULL, giving you an 'Unhandled exception' (trying to access something in a NULL pointer).
So, you code should look something like this (minus the comments, of course, which just explain what I'm doing):
void CMgen1View::OnInitialUpdate()
{
CRecordView::OnInitialUpdate();
m_pSet = GetDocument()->m_mgen1Set;
LoadListbox();
}
Hope that helps!
Sincerely,
Alexander Wiseman
Est melior esse quam videri
It is better to be than to seem
|
|
|
|
|
Hi All,
Can anyone tell me what should be done to provide the resize option to user for modeless dialog
Thanks in advance
Uday
|
|
|
|
|
|
I'm trying to enumerate all the different formats of a specific driver but acmFormatEnum keeps returning MMSYSERR_INVALPARAM (At least one parameter is invalid.). Anyone have an example of how to do this? Here's my code (id is a valid driver identifier of a driver):
ACMFORMATTAGDETAILS acmTagDetails;
<br>
void StartEnum()
{
HACMDRIVER hAcm;
acmDriverOpen(&hAcm, id, 0);
acmTagDetails.cbStruct = sizeof(ACMFORMATTAGDETAILS);
acmFormatTagEnum(hAcm, &acmTagDetails, acmTagCallback, NULL, 0);
acmDriverClose(hAcm, 0);
}
<br>
BOOL WINAPI acmTagCallback(HACMDRIVERID hadid, LPACMFORMATTAGDETAILS paftd, DWORD dwInstance,DWORD fdwSupport)
{
ACMFORMATDETAILS acmFormat;
HACMDRIVER hAcm;
memset(&acmFormat, 0, sizeof acmFormat);
acmFormat.cbStruct = sizeof(ACMFORMATDETAILS);
acmMetrics(NULL, ACM_METRIC_MAX_SIZE_FORMAT, &acmFormat.cbwfx);
acmFormat.pwfx = (WAVEFORMATEX *)malloc(acmFormat.cbwfx);
acmDriverOpen(&hAcm, hadid, 0);
acmFormatEnum(hAcm, &acmFormat, formatCallback, NULL, ACM_FORMATENUMF_WFORMATTAG);
acmDriverClose(hAcm, 0);
return TRUE;
}
<br>
BOOL WINAPI formatCallback(HACMDRIVERID hadid, LPACMFORMATDETAILS pafd, DWORD dwInstance, DWORD fdwSupport)
{
ACMDRIVERDETAILS details;
details.cbStruct = sizeof(details);
acmDriverDetails(hadid, &details, NULL);
SendMessage(GetDlgItem(ghWnd, IDC_FORMATS), LB_INSERTSTRING, 0, (LPARAM)details.szLongName);
return TRUE;
}
Thanks for your help!
-Rune Svendsen
|
|
|
|
|
You have to many members not initialized in acmTagCallback. MSDN says that for ACM_FORMATENUMF_WFORMATTAG , you must initialized dwFormatTag member of the ACMFORMATDETAILS structure must be equal to the wFormatTag member of WAVEFORMATEX. By the way, you need to free the memory you allocate with malloc or you may want to use a local variable : WAVEFORMATEX waveFormat = { 0 } ; and assign it to acmFormat.pwfx = &wafeFormat ; You still need to initialize wafeFormat with the format that you are looking
for. An 8Khz, 8-bit, 1 channel may be your starting point. Sorry if I don't have code to show you right now!
Good luck
VOTD:"5. The Lord loves righteousness and justice;
the Earth is full of his unfailing love. "-Psalm 33:5
|
|
|
|
|
Try to initialize your WAVEFORMATEX struct with this function:
void InitFormat(LPWAVEFORMATEX pwfx, WORD wChannel, DWORD dwSamplesPerSec, WORD wBitsPerSample)
{
_ASSERTE( NULL != pwfx );
pwfx->cbSize = sizeof(WAVEFORMATEX);
pwfx->wFormatTag = WAVE_FORMAT_PCM;
pwfx->nChannels = wChannel;
pwfx->nSamplesPerSec = dwSamplesPerSec;
pwfx->nAvgBytesPerSec = dwSamplesPerSec * wChannel * (wBitsPerSample>>3);
pwfx->wBitsPerSample = wBitsPerSample;
pwfx->nBlockAlign = wChannel * (wBitsPerSample>>3);
}
VOTD:"5 I know that the Lord is great, that our Lord is greater than all gods.
6 The Lord does whatever pleases him, in the heavens and on the earth, in the seas and all their depths."- Psalm 135:5-6
|
|
|
|
|
Something drive me tired and crazy.I want to put ten sting into COleSafeArray.Could someone pleaseeee give me a sample code?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
COleSafeArray saVector;
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = 10;
saVector.Create(VT_BSTR, 1, rgsabounds);
long index;
_bstr_t val = "Your string";
for(index=0; index<10; index++)
{
saVector.PutElement(index, (const WCHAR*)val);
}
VOTD:"5. The Lord loves righteousness and justice;
the Earth is full of his unfailing love. "-Psalm 33:5
|
|
|
|
|
Hi,
I am looking for a way to convert a double to the char representation, ie. put double, which is eight bytes, to char[8];
Example:
double nDb = 12.34;
char szDb[8];
szdB would hold the character representation of nDb which might look something like:
[0] 0''
[1] 0''
[2] 0''
[3] 0''
[4] 0''
[5] 0''
[6] 51'3'
[7] 64'@'
Thank you.
|
|
|
|
|
try snprintf
-c
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
memcpy(szDb, &nDB, sizeof(double));
or, if you want to save keystrokes
(double & )szDb = nDb;
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
I call a modal dialog to input a number. The var that i added to the class has limits but these don't get checked until the calling (parent) dialog closes. Is there an option that I need to set or do i need to range ckeck on my own?
This is my call:
if(GetNumDlg.DoModal() == IDOK)
{
calleddialog = 0;
m_leftscale = atoi(GetNumDlg.m_numdisplayed);
UpdateData(FALSE);
//This will set the focus to another control to keep this dialog from popping up
//everytime focus returns
//
CEdit* pNextField = (CEdit*)GetDlgItem(IDOK); pNextField->SetFocus();
}
|
|
|
|
|
Can't you map your edit control to int variable with range validation? You can do this in ClassWizard.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
that is where I set the var up and I did use the range checking for it...just doest seem to check it until I try to exit the calling window.\thanks
|
|
|
|
|
I'm not really sure what exactly are you doing. In the code you've posted you have atoi call. This means that your dialog has string variable, not integer one.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
This is where the problem lies. This is a pop up number entry keyboard. I have two vars one is a string and the other is the integer. I use the string to create the number...make any sence?
|
|
|
|