|
Ok, thanks , i will check it, very usefull. But for the other data types is it ok to save data i as described before? , I mean pherhaps is not the elegant way but it's working (not with CString), as I have to finish this work for tomorrow I was hoping there was a easier way, I only have to store some few words.
|
|
|
|
|
It would be easier to provide a function to save and a function to load the structure (functions in the structure itself). These functions will save and load all members of the structure. For the CString type, you first have to save the lenght of the string then the string itself (when loading, you read the lenght and then read that many characters from the file).
|
|
|
|
|
If you are using MFC then you could use the CArchive[^] class.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
hi
what is the note of using SHFileOperation function in win XP?
my program work correctly in vista but in XP it is crashed!
please help me
Zo.Naderi-Iran
|
|
|
|
|
Connot you debug it? At least, to get better help, you should post here the relevant code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
oh, thank you and excuse me
my problem solved.
its problem was in VS 2005. with VS 2008, it is ok.
thanks
Zo.Naderi-Iran
|
|
|
|
|
Hi all,
I want save the image with the annotation made on it.But i am able to save only the image but not the annotation.
I am using LeadTools 16.5 version(C DLL).
I know this is not the right place for this question.
But if anyone knows how to save the image with annotation .please help me.
I will be really greatful to you
Thanks
Raj
|
|
|
|
|
Hi
You musr ask your question in leadtools forum.
Are you working on a DICOM/PACS project?
www.logicsims.ir
|
|
|
|
|
Hi All
I try to create database and table in Access database through this way.
_CatalogPtr m_pCatalog = NULL;
CString con="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.mdb;Jet OLEDB:Engine Type=5";
HRESULT hr = S_OK;
try
{
TESTHR(hr = m_pCatalog.CreateInstance(__uuidof (Catalog)));
m_pCatalog->Create((_bstr_t)con);
}
catch(_com_error pCE)
{
}
.
.
.
.
m_pCatalog->Release();
CoUninitialize();
Database name(test.mdb) read from list(list have more than one database name).I use here m_pCatalog->Release();
Now when i select different database name that time this line TESTHR(hr = m_pCatalog.CreateInstance(__uuidof (Catalog)));
through exception.
Exception show
HRESULT CreateInstance(const CLSID& rclsid, IUnknown* pOuter = NULL, DWORD dwClsContext = CLSCTX_ALL) throw()
{
HRESULT hr;
point out this line
_Release();
if (dwClsContext & (CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)) {
IUnknown* pIUnknown;
hr = CoCreateInstance(rclsid, pOuter, dwClsContext, __uuidof(IUnknown), reinterpret_cast<void**>(&pIUnknown));
if (SUCCEEDED(hr)) {
hr = OleRun(pIUnknown);
if (SUCCEEDED(hr)) {
hr = pIUnknown->QueryInterface(GetIID(), reinterpret_cast<void**>(&m_pInterface));
}
pIUnknown->Release();
}
}
else {
hr = CoCreateInstance(rclsid, pOuter, dwClsContext, GetIID(), reinterpret_cast<void**>(&m_pInterface));
}
if (FAILED(hr)) {
m_pInterface = NULL;
}
return hr;
}
I use m_pCatalog->Release() because once i create database and table then i try to free particular database.
Please help me
|
|
|
|
|
What was the exception message?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks for reply
Unhandled exception at 0x004098ec in test.exe: 0xC0000005: Access violation reading location 0x00000008
|
|
|
|
|
Did you call Release , CoUninitialize , and then CreateInstance aqain?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Hi,
When I am trying to import data from excel to table it's giving me following error :-
An exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll but was not handled in user code
Additional information: External table is not in the expected format.
I am using following code:-
Collapse
OleDbConnection excelConn = new OleDbConnection();
excelConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + filelocation + "';Extended Properties=Excel 8.0");
excelConn.Open();
|
|
|
|
|
if i open the excel file with excel 2003, then i'll do the query again for the file,everything goes fine, why?
how can i get the data from xls, without open it in the excel 2003 at the same time, who can help me ? thanks very much!
|
|
|
|
|
Hi everyone!
I'm using ReadDirectoryChangesW for tracking any changes in the dedicated Source folder and apply it to the Destination folder.
But, when multiple files are selected and deleted at once in the Source folder, only the first file is deleted in the Destination folder.
Is there any way to delete all files at once?
Thanks beforehand.
|
|
|
|
|
I haven't used this myself, however reading the MSDN documentation it seems ReadDirectoryChangesW fills a buffer with one or more FILE_NOTIFY_INFORMATION structures, of which the NextEntryOffset field is the key to finding the next (unless zero). From your description, it seems you are ignoring this field.
[ADDED] The doc also says nothing gets returned when the buffer is too small, which is more likely to happen when lots of things need reported at the same time. You may want to ask for a bigger buffer. [/ADDED]
|
|
|
|
|
mints555 wrote: But, when multiple files are selected and deleted at once in the Source folder, only the first file is deleted in the Destination folder.
If you are having trouble deleting files, what does that have to do with ReadDirectoryChangesW() ?
What does your deletion code look like?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
hi guys,,,
i'm have a project about MFC. how to create bitmap from mousemovent??
for mousemovent i'm can write to picturebox.
the code is written in mfc wizard exe in a dialog based application.
for picturebox -> IDC_PIC
for button -> IDC_SAVE
my code:
void CSignature1Dlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_pic1.GetSafeHwnd();
HCURSOR hcur = NULL;
CRect rc;
m_pic1.GetClientRect(&rc);
rc.NormalizeRect();
rc.left=0;
rc.right=250;
rc.top=0;
rc.bottom=250;
POINT MousePosition = point;
BOOL isOnPictureControl = PtInRect(&rc, MousePosition);
if((m_iPrevX >=rc.left && m_iPrevX <=rc.right) && (m_iPrevY >=rc.top && m_iPrevY <=rc.bottom )){
if((nFlags & MK_LBUTTON) == MK_LBUTTON)
{
CDC* pDC = m_pic1.GetDC();
CDC dcMem;
dcMem.CreateCompatibleDC(pDC);
dcMem.SelectObject(&m_bmpBitmap);
CPen pen (PS_SOLID,2,RGB(0,0,0));
pDC->SelectObject (&pen);
pDC->MoveTo(m_iPrevX,m_iPrevY);
pDC->LineTo(point.x,point.y);
pDC->SetPixel(point.x,point.y, RGB(0,0,0)) ;
m_iPrevX=point.x;
m_iPrevY=point.y;
}
}
CDialog::OnMouseMove(nFlags, point);
}
void CSignature1Dlg::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
HCURSOR hcur = NULL;
CRect rc;
m_pic1.GetClientRect(&rc);
rc.NormalizeRect();
m_iPrevX=point.x;
m_iPrevY=point.y;
CDialog::OnLButtonDown(nFlags, point);
}
void CSignature1Dlg::OnSave()
{
// TODO: Add your control notification handler code here
?????????
}
so give me advice, how to can create and save the mousemovent into bitmap???
i hope u can help me...
|
|
|
|
|
josipahutar wrote: so give me advice, how to can create and save the mousemovent into bitmap???
See the Scribble MFC sample[^].
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
thx your reply sir..
i dont understand because i newbie in MFC..
so can u give me a example about my problem...
Regard's
Johannes
|
|
|
|
|
josipahutar wrote: so can u give me a example about my problem...
This MFC tutorial gives a little bit of everything, even for newbies.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi,
The example is the CScribbleView class code for:
virtual void OnDraw(CDC* pDC);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
.
If you cannot study this code and understand how it is an answer to your question think of another kind of working area
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
hello guys... i got this small speech api sample and tried to compile but got this error.
error C2440: 'static_cast' : cannot convert from 'void (__thiscall CSpeechDlg::* )(void)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
This is where it takes me when hiting on the error.
ON_MESSAGE(WM_RECOEVENT,OnRecoEvent)
This is the function signature of OnRecoEvent
void CSpeechDlg::OnRecoEvent()
And this is what WM_RECOEVENT is..
#define WM_RECOEVENT WM_USER+5 // Window message used for recognition events
what should I do? thnx
modified on Monday, December 13, 2010 3:44 AM
|
|
|
|
|
Your OnRecoEvent() function is called in response to a Windows message so it must follow the rules as explained in the error message. That is to say, it takes a WPARAM and an LPARAM as input parameters and returns an LRESULT .
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|