|
That's the same thing I was doing in mine!! However, I saw that in your class the macros IMPLEMENT_DYNAMIC and DECLARE_DYNAMIC weren't there, so I removed that from mine also. Then just to be safe, I deleted the edit box, made another one and started all over. Now it works!!! I thank you a million times.
[insert witty comment here]
bdiamond
|
|
|
|
|
i'm trying to just paint to a dialog using CreateCompatibleDC(), FillRect(), etc, but i cant find the right spot to paint at, i've tried all the OnInitDialog(), etc, doesnt work, only time it works is in OnPaint() then it paints it forever and ever, help me!
|
|
|
|
|
You need to put your painting in OnPaint.
OnPaint will be called whe region needs to get repainted ( when it is Invalidated ).
If your dialog stands on top, and nothing is happening, it should not repaint itself for nothing.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
evilslope wrote:
when do i paint?
This is dependant on you geographic location. Generally it is best to paint during the driest part of the year.
-- signature under construction -- -pete
|
|
|
|
|
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
With Windows XP, the borders of many controls are now flat (blue with the default theme).
But for TreeCtrl, the borders stay edge.
With the DrawThemeBackground API, I can't found parameters to draw those borders.
Is anyone know how to retrieve informations about current border color ?
Thanks
|
|
|
|
|
Hi,
I found suddenly that in Windows CE .NET (Platform Builder)/eMbedded Visual C++ there is no bsearch function!!! which normally exist in VC++.
How I can get around that issue? Maybe I can get just code for that function which I can icorporate into my.
Thanks in advance.
Val
|
|
|
|
|
It's very easy to roll your own binary search function. With some knowledge of your data structure, someone here can surely be of help.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
hi!
i'm trying to write a custom writer sink using the IWMWriterSink but it doesn't work at all. can someone help me, best provide some simple example code? also, how to i then create my customer writer sink object so i can attach it to the writer using AddSink?
my current code looks like this:
--
class CMySink: public IWMWriterSink
{
public:
HRESULT STDMETHODCALLTYPE OnHeader(
/* [in] */ INSSBuffer *pHeader)
{
return S_OK;
}
HRESULT STDMETHODCALLTYPE IsRealTime(
/* [out] */ BOOL *pfRealTime)
{
return S_OK;
}
HRESULT STDMETHODCALLTYPE AllocateDataUnit(
/* [in] */ DWORD cbDataUnit,
/* [out] */ INSSBuffer **ppDataUnit)
{
return S_OK;
}
HRESULT STDMETHODCALLTYPE OnDataUnit(
/* [in] */ INSSBuffer *pDataUnit)
{
return S_OK;
}
HRESULT STDMETHODCALLTYPE OnEndWriting( void)
{
return S_OK;
}
// QueryInterface
STDMETHODIMP QueryInterface(REFIID refiid, void **ppv)
{
if(1 || refiid == IID_IUnknown)
{
*ppv = static_cast<iwmwritersink*>(this);
static_cast<iwmwritersink*>(this)->AddRef();
return S_OK;
}
else
{
*ppv = NULL;
return E_NOINTERFACE;
}
return S_OK;
}
// AddRef
STDMETHODIMP_(ULONG) AddRef()
{
return InterlockedIncrement((PLONG)&refCount_);
}
// Release
STDMETHODIMP_(ULONG) Release()
{
ULONG ul = 0;
if((ul = InterlockedDecrement((PLONG)&refCount_)) == 0)
{
delete this;
}
return ul;
}
ULONG refCount_;
};
--
thanks for any help!!
|
|
|
|
|
I am writing a small project using ODBC which can add, delete and edit records in the database, I have accomplished it, but I don't know how to write the code which I can dump the whole database, I need some advices or sample code, Thanks in advance!
|
|
|
|
|
A simple way (if your database is fairly small) would be to just generate a load of insert statements for all the tables in your database. These could then be replayed in bulk to restore a database.
store your internet favourites online - www.my-faves.co.uk
|
|
|
|
|
Does it necessarily need to go to a text file? If not, I've used this code before to backup up a database:
CShellFileOp ShellFileOp;
CDatabase *pDatabase = GetDatabase();
CString strDBNameFrom,
strDBNameTo;
TCHAR szFilename[_MAX_FNAME],
szExt[_MAX_EXT];
BOOL bAPICalled;
ASSERT(! m_rOptionsInfo.m_strBackupFolder.IsEmpty());
strDBNameFrom = pDatabase->GetDatabaseName();
if (! strDBNameFrom.IsEmpty())
{
strDBNameFrom += _T(".mdb");
_splitpath(strDBNameFrom, NULL, NULL, szFilename, szExt);
strDBNameTo.Format(_T("%s\\Backup of %s%s"), m_rOptionsInfo.m_strBackupFolder, szFilename, szExt);
ShellFileOp.AddSourceFile(strDBNameFrom);
ShellFileOp.AddDestFile(strDBNameTo);
ShellFileOp.SetOperationFlags(FO_COPY, AfxGetMainWnd(), FOF_NOCONFIRMATION);
if (ShellFileOp.Go(&bAPICalled) != FALSE)
AfxMessageBox(IDS_MSG_BACKUPSUCCESS);
else
AfxMessageBox(IDS_MSG_BACKUPFAILED);
}
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
there standart sollution for this case via xml export/import file.
the only problem i faced was that i couldn't write blob data to the xml: i write them at the end of xml-file in the specified format to simply identify for which records they belong to.
4apai
There're no impossible tasks. There're tasks that required infinite period of execution time.
|
|
|
|
|
You could always Base64 encode your blobs and store them in the XML node structure....
onwards and upwards...
|
|
|
|
|
hm, what does it mean base64 encode?
do u've a sample?
4apai
There're no impossible tasks. There're tasks that required infinite period of execution time.
|
|
|
|
|
I' using visual C++ to add a feature to my program, that enables the user to right-click on any menu item, and the corresponding topic is opened in a *.chm type manual i have already created.
I don't have any clue on how to do this , or if other programming languages are necessary like XML, Java,, etc. But if anyone can offer any ideas on how to this, please let me know.
Thanks for your time,
Eduardo M. Rey
Ed
|
|
|
|
|
If you can already process the right click on the menu item, then you just need to read about the HTMLHelp function.
You need some scheme to map the menu item identifier to the help topic in your CHM file, of course.
|
|
|
|
|
Thanks for your response, it was very helpful.
Brief, and informative.
Ed
|
|
|
|
|
I am writing a database application, I use the MS ODBC driver for Oracle. I want to view, edit add/delete records on a Oracle database. After I building the executable, there was NO error, but when I ran the EXE, I knew the database had been connected and opened correctly, because the messagebox had been prompted and showing "the database has been opened", but in the next step, an error messagebox prompted, showing the Runtime-Library error. I don't know where is wrong, and need some help, Thanks!
Here is the code for openning the database and table.
CDatabase m_db;
BOOL flag=FALSE;
flag=m_db.Open(_T("OracleDSN"), FALSE,FALSE,_T("ODBC;UID=ADMIN"));
if(flag)
MessageBox("the database has been opened");
else
MessageBox("failed to open the database");
CRecordset m_recordset(&m_db);
m_recordset.Open(CRecordset::forwardOnly, "select * from table_1");
|
|
|
|
|
chocm wrote:
...but in the next step...
Which statement exactly?
chocm wrote:
I don't know where is wrong, and need some help, Thanks!
Simply place a breakpoint on the CRecordset m_recordset(&m_db) statement and single-step through the code from that point.
I notice you are not handling exceptions, especially CDBException . Why? These go a long way in tracking down problems like you are currently experiencing.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have set breakpoint, but it showed no info that is helpful, I still don't know where is wrong.
|
|
|
|
|
But I still get no helplful info by stepping
|
|
|
|
|
Did you (still) get a runtime error? Is it reproducible (at a particular statement)? Did you implement a try/catch block?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|