|
|
Do you know any class that can put a BMP as a background in a window??
I know that CpictureWindow here on CodeProject but I don't handle it!
Do you know a class that can do that!??
Nikado
|
|
|
|
|
What problems do you have with CPictureWindow
Do you want to tile this bitmap across the window, stretch the bitmap to fit the window or just paint it in the centre?
Michael
|
|
|
|
|
Try this
http://www.codeproject.com/docview/mditab.asp
A bit more than what you need but you can exact what you need from it.
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
my application in Debug mode is asserting this & aborting
If this ASSERT fails, a bad pointer has been passed in. It may be
* totally bogus, or it may have been allocated from another heap.
* The pointer MUST come from the 'local' heap.
*/
_ASSERTE(_CrtIsValidHeapPointer(pUserData))
Kindly Help me
anshuman
|
|
|
|
|
You need to post your code that is causing the problem.
Michael
|
|
|
|
|
BOOL CEthnewApp::ParseCmdInfo(LPCSTR m_lpCmdLine)
{
char *str;
int nCnt[CMDLINE_ARGS],nStartIndex=0;
CString szCmdLineParam;
char szCmdLineParam1[CMDLINE_ARGS][12];
theApp.m_bDwnld = TRUE;
BOOL bSuccess = FALSE;
szCmdLineParam.Format("%s",m_lpCmdLine);
for(int Index=0;Index< CMDLINE_ARGS;Index++)
{
nCnt[Index] = szCmdLineParam.Find('/',(nStartIndex+1));
*szCmdLineParam1[Index] = _T('\0');
for(int j = nStartIndex,ii = 0;j<ncnt[index];j++,ii++)
{
="" szcmdlineparam1[index][ii]="szCmdLineParam.GetAt(nStartIndex+ii);
" }
="" ;
="" nstartindex="nCnt[Index]+1;
"
="" if(!strncmp(szcmdlineparam1[2],"~upl0001.tmp",12))
="" m_bdwnld="FALSE;
" m_dwhwnd="strtol(szCmdLineParam1[0],&str,16);
" m_lparam="strtol(szCmdLineParam1[1],&str,16);
" m_szupldfilename.format("%s",szcmdlineparam1[2]);
="" char="" buff[10];="" only="" for="" formmatting="" handler="" recognition="" need="" not="" to="" be="" changed="" able="" allocate="" buffer="" in="" release="" mode
="" wsprintf(buff,"%ld",m_dwhwnd);="" bsuccess="TRUE;
" else
="" dword="" dwtemp;
="" getting="" hwnd="" qmgr="" sending="" message="" qmgr
="" dwtemp="strtol(szCmdLineParam1[1],&str,16);" m_szdwldprjname.format("%s",(lpcstr)szcmdlineparam1[2]);
="" m_dwprotid="((dwTemp)&0xff00)">>8; // getting protocol ID selected in Setup of Qmgr
m_dwGPMachineID = (dwTemp)&0x00ff; // getting ddoID for panel selected in Qmgr.
m_szDwldPrjName.MakeUpper();
bSuccess = TRUE;
}
return bSuccess;
}
This code is for Command line parsing is there any other way of getting parsing done My command line arguments are "/6ee/4d2f/TEST/"
|
|
|
|
|
Which line of code is called before you get the assert?
>This code is for Command line parsing is there any other way of getting >parsing done My command line arguments are
The are a couple of command line parsers on code project, including
http://www.codeproject.com/cpp/caacommandlineclass.asp
Michael
|
|
|
|
|
last line "return bsuccess"
i am not very sure how can i implemnet the code u have suggested could u help me in revealing idea of command lin parsing possible give a code snippet
Aanshuman
|
|
|
|
|
last line "return bsuccess"
i am not very sure how can i implemnet the code u have suggested could u help me in revealing idea of command lin parsing possible give a code snippet
Aanshuman
anshuman
|
|
|
|
|
I have a class, it does apsolutely nothing extra ordinary. It wraps a variable of type CArray<class *,class="" *="">, and allowing various other parts of the software access to the contained in this CArray.
See the code below :-
CArray(CQuestion *,CQuestion *) m_caQuestionSet;
However sometimes (approx 1 in 4 times) the destructor code generates an Exception (this is Windows CE so I am using Structured Exception Handling).
See the code below :-
CQuestionSet::~CQuestionSet()
{
__try
{
CQuestionSet::SaveOut();
CQuestionSet::SaveOutAsXML();
}__except(InfoExceptionFilter(GetExceptionInformation()))
{
TRACE0("CQuestionSet::~CQuestionSet(): Exception Occured");
}
}
both SaveOut() and SaveOutAsXML() has their own Exeption Handler, which is never called. Whats generating the damn exception in ~CQuestionSet;
Regards
Ray
"Je Suis Mort De Rire"
|
|
|
|
|
I am creating a DB with ADOX, and it opens fine in Access, I can add records there. If I view the file in my program, opening the recordset like this:
_RecordsetPtr records = NULL;
records.CreateInstance(__uuidof(Recordset));
try
{
records->CursorType = adOpenStatic;
records->CursorLocation = adUseClient;
records->Open("SELECT * FROM FileDatabase",
_variant_t((IDispatch*)m_Connection, true), adOpenKeyset, adLockOptimistic,
adCmdUnknown);
}
catch(...)
{
}
if (records->RecordCount == 0) return S_FALSE;
records->MoveFirst();
It works. I do a do while !records->adoEOF and it reads everything in and displays it fine. I am trying to add records, and I use the exact same code to open then DB, but then I am checking each potential entry to make sure the primary key ( a filepath ) is not duplicated:
for (it = vecFileEntries.begin(); it != vecFileEntries.end(); ++it)
{
if (records->RecordCount != 0)
records->MoveFirst();
CComBSTR bstrPath;
(*it)->get_FilePath(&bstrPath);
char * pStr = new char[bstrPath.Length() + 24];
memset(pStr, 0, bstrPath.Length() + 24);
sprintf(pStr, "[FilePath] = \'%s\'", (char*)(_bstr_t)bstrPath);
try
{
records->Filter = (bstr_t)pStr;
}
catch (...)
{
MessageBox(NULL, "Error", pStr, 0);
}
if (records->adoEOF)
{
and so on - the point is that here before AND after the filter, no matter how many records I have, the recordset->recordcount is always 1, and so nothing is ever added. I tried checking recordcount directly instead of adoEOF, I tried removing the check ( it crashed when trying to add records ). I've been through in Access to make sure the properties of the table are the same, I dunno what else to do.
This is how I create the file:
HRESULT hr = S_OK;
ADOX::_CatalogPtr m_pCatalog = NULL;
ADOX::_TablePtr m_pTable = NULL;
try
{
TESTHR(hr = m_pCatalog.CreateInstance(__uuidof(ADOX::Catalog)));
char * pChar = new char[400];
memset(pChar, 0, 400);
sprintf(pChar, "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=4;Data Source=%s;", (char*)DatabasePath);
m_pCatalog->Create(pChar);
delete [] pChar;
TESTHR(hr = m_pTable.CreateInstance(__uuidof(ADOX::Table)));
m_pTable->PutName("FileDatabase");
m_pTable->Columns->Append("FileName",ADOX::adVarWChar, 255);
m_pTable->Columns->Append("FilePath",ADOX::adVarWChar,255);
m_pTable->Columns->Append("FileLength",ADOX::adInteger,0);
m_pTable->Columns->Append("TimesDownloaded",ADOX::adInteger,0);
m_pTable->Columns->Append("LastModified",ADOX::adInteger,0);
m_pTable->Columns->Append("Frames",ADOX::adInteger,0);
m_pTable->Columns->Append("Seconds",ADOX::adInteger,0);
m_pTable->Columns->Append("Width",ADOX::adInteger,0);
m_pTable->Columns->Append("Height",ADOX::adInteger,0);
m_pCatalog->Tables->Append(
_variant_t((IDispatch *)m_pTable));
}
catch(_com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
MessageBox(NULL, bstrDescription, bstrSource, 0);
return E_FAIL;
}
catch (...)
{
MessageBox(NULL, "General Error Creating Database", "Error", 0);
return E_FAIL;
}
return S_OK;
Any help appreciated, as always.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Few points to consider
1. using the recordcount, will not always give you the correct count of records, this is only an indicator (watermark) of how many records exist.
I Suggest you use a SELECT COUNT(*) FROM [TABLE] query to get the correct record count.
2. When you use Column->Append
the Size of the adInterger is not 0, but sizeof(long)
I am not sure if this will cure your problem, but it may help
|
|
|
|
|
Hello,
Does anyone know of a utility or sample code that creates a file of custom size? I would like to do some testing with my application with reduced disk space and would like to be able to create an arbitrary file with a defined filesize. For example, if I want to test what happens when I save a file to a floppy that has a 1MB file already on it. The 1MB file would be the file that I created to reduce disk space.
Any ideas?
Thanks in advance!
Derek
|
|
|
|
|
Try this (I use similar code when receiving an LPR data file where I know the filesize in advance and need to ensure the disk space is available):
CFile file;
file.Open("c:\\tmp\\test.dat", CFile::modeCreate|CFile::modeWrite);
file.SetLength(/* INSERT FILE SIZE HERE */);
file.Close();
Regards.
|
|
|
|
|
I just did a quick test with your SIMPLE idea - works great!
Many thanks!
|
|
|
|
|
Hi,
Is there an MFC / API function i can call to tell me
1) How much Total Physical memory is available in a system
2) How much of this is used, and how much is available
Thanks for any help
Jase
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
View your digital photos and images with ease using the ultimate desktop image manager for Microsoft Windows
Download your free copy of SlideShow Desktop today from http://www.slideshowdesktop.com
|
|
|
|
|
On NT, this is pretty easy using the performance data helper library (PDH.DLL). I think it's a bit more tricky in Win9x system though.
If you need any sample code, then drop me a line, though a search on the MSDN for PDH will point you in the right direction.
|
|
|
|
|
Take a look at GlobalMemoryStatus().
With this function you can get all the information you need about memory
|
|
|
|
|
I want to implement the "Send To" command, that sends the application document. This is provided by MFC in the CDocument class, however it uses MAPI and MAPI doesn't support HTML mails (i.e. "Content-Type: text/html").
I could use SMTP to do this, but then the user has to manually enter the SMTP server address, recipient address, etc, etc.
Can anyone tell me what the best way of doing this?
Thanks,
Ed
|
|
|
|
|
I have a problem with CComBSTR's. I create them using new , work with them a bit, pass them to a COM interface with string->Detach(), and after that I delete them with delete .
Every string leaks 8 bytes
Can anyone tell me why?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Once you call Detach(), the CComBSTR object no longer manages the string, so the leak you're seeing is probably the contents of the string.
Pass the string as (*string) which will call CComBSTR::operator BSTR to do the conversion.
--Mike--
http://home.inreach.com/mdunn/
"The Earth is doomed." -- Rupert Giles
your with and
|
|
|
|
|
Nope, it's exactly 8 bytes for each string, no matter how long they are...
If I call Copy() it the same
I'll try the (*string) tomorrow at work...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hello,
I'm trying to make my last program easier and more powerful, in order to do this I would like to allow the user to choose the language that the program use, there's only a problem: I don't have any idea of how to begin... what should I know?
the other thing I would like to do is to prepare the same program to work with and without touch screens, then I would like to be capable to redimensionate some controls in order to allow the fingers work as the mouse pointer. Should I create two kinds of dialog for each window? (one for the touch and the other for the normal screen?).
As always thank you very much.
|
|
|
|
|
|