|
Didnt read it myself but guess its what u need!
http://www.codeproject.com/useritems/linkchecker.asp
Papa
Murex Co.
|
|
|
|
|
I experience the following problem after I have upgraded to MDAC 2.7 RTM Refresh (Build: 2000.81.9001.00): I have a COM component and I am using ODBC API functions to do a bulk copy load (bcp_init, bcp_readfmt, bcp_exec). For some reason, bcp_exec method fails somewhere in the driver's code. In ONLY happens when my COM component is running under COM+. If I don't register the component in COM+ then everything works perfectly! Here is some stack information I am getting when it fails:
Exception: C0000005
Address: 0x1F9CD9A3
Call Stack:
SQLSRV32!SQLGetConnectAttrW + 0x80
ODBC32!MpHeapCreate + 0x7250
ODBC32!SQLGetDiagRecW + 0x2DF
ODBC32!SQLSetConnectAttrW + 0x194
ODBC32!SQLSetConnectAttrW + 0x30
odbcbcp!bcp_exec + 0x60
...
Note, everything worked fine with MDAC 2.7 RTM (Build: 2000.81.7713.00). Microsoft claim they didn't change any code in MDAC 2.7 RTM Refresh, they only changed the build number. However, the fact is something that has worked before suddently stopped working after I have upgraded.
If you have experienced a similar problem or have any clue why this is happening please let me know. I need this urgently. I appreciate any help.
Thanks in advance,
Dmitry
Make things as simple as possible, but no simpler. -- Albert Einstein
|
|
|
|
|
hi .. ive seeked the hlp before and i got a response but still after making those changes im not able to save the bitmap file.)
here is the code which im writing .plz tell me where im doing wrong.Or plz snd me the correct code for dat
thanks
void COpenbitmapDlg::OnButtonBmp()
{
// TODO: Add your control notification handler code here
BOOL COpenbitmapDlg::WriteDIB(LPTSTR szFile, HANDLE hDIB)
{
//----------------------------------------
BITMAPFILEHEADER hdr ;
LPBITMAPINFOHEADER lpbi ;
if(!hDIB)
return FALSE ;
CFile file ;
if(!file.Open(szFile,CFile::modeWrite|CFile::modeCreate))
return FALSE ;
lpbi=(LPBITMAPINFOHEADER)hDIB;
int nColors = 1 << lpbi->biBitCount;
hdr.bfType = ((WORD) ('M' << 8) | 'B'); // is always "BM"
hdr.bfSize = GlobalSize (hDIB) + sizeof( hdr );
hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;
hdr.bfOffBits = (DWORD) (sizeof( hdr ) + lpbi->biSize +
nColors * sizeof(RGBQUAD));
BYTE* pDib =(BYTE*)GlobalLock(hDIB);
file.Write( &hdr, sizeof(hdr) );
// Write the DIB header and the bits
// file.Write( lpbi, GlobalSize(hDib) );
file.Write( lpbi, GlobalUnlock(pDib) );
return TRUE;
}
////////////////////////////////
// calling the above function here
CString m_sBitmap ;
CClientDC dc(this);
static char BASED_CODE szFilter[] = "Bitmap Files (*.bmp)|*.bmp|JPEG Files *.jpeg";
// Create the File Open dialog
CFileDialog m_ldFile(TRUE, ".bmp", m_sBitmap,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter);
// Show the File Open dialog and capture the result
if (m_ldFile.DoModal() == IDOK)
{
// Get the filename selected
m_sBitmap = m_ldFile.GetPathName();
// Load the selected bitmap file
//MessageBox(m_sBitmap);
HBITMAP hBitmap = (HBITMAP)::LoadImage(AfxGetInstanceHandle(),
m_sBitmap, IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE | LR_CREATEDIBSECTION);
// Do we have a valid handle for the loaded image?
if (hBitmap)
{ CBitmap m_bmpBitmap;
m_bmpBitmap.Attach(hBitmap);
BITMAP bmp;
m_bmpBitmap.GetBitmap(&bmp);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
dcMem.SelectObject(&m_bmpBitmap);
dc.BitBlt(0,0,bmp.bmWidth,bmp.bmHeight,&dcMem,0,0,SRCCOPY);
WriteDIB("C:\\1.BMP",hBitmap);
}
}
}
looking forward from all the gurus of code
|
|
|
|
|
hDIB is a HBITMAP, not a HANDLE.
go here:
http://www.codeproject.com/bitmap/cximage.asp
and see the difference between CreateFromHBITMAP() and CreateFromHANDLE().
|
|
|
|
|
abey kitni dafa question poochay gaa, bataya tha na key tiberian sun ki cd day kar jaa phir sab sawaloon ka jawab mil jaye gaa.
|
|
|
|
|
Here's a couple of typedefs I'm using
typedef map<cstring, cstring=""> A;
typedef map<cstring, a=""> B;
typedef map<cstring, b=""> C;
I can have anywhere from 4 to 8 C's
Each C can have ~30 B's
And Each B can have anywhere from 2 to 250 A's
The reason a map was choosen is because the speed of searches is the most important and these will only be built once (no adds or deletes).
To build these maps takes about 5 seconds (1.7 Ghz PIV). That's not so bad except a GUI can't be displayed until the maps are built. It looks a little sloppy having that lag.
Anyway, I trying to find a way to speed up the building of these maps. I'm guess that if I can preallocate the maps to a typical usage (4 C's 30 B's and 150 C's), that would improve things.
Any ideas?
|
|
|
|
|
Are you building your maps top-down (first A s, then B s, finally C s) or bottom-up? The latter order is likely to be way faster, since B s and C s store copies of the enclosed types. So, instead of writing
A a;
B b;
b["Hello"]=a; you should write
B b;
A& a=b["Hello"];
Other ways to improve your code:Define B as a map<CString,A*> (and similarly wih C ) to prevent excessive copying. If this imposes a problem with keeping track of the objects (to do the final cleanup), consider some ref-counted smart pointer instead.
Give my block allocator a try (though I wouldn't expect but a modest improvement thru its use.)Good luck.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
In your case (no inserts or deletes), you could achieve similar search performance and faster building with sorted vector s and binary_search algorithm.
|
|
|
|
|
If you use .NET then you may consider using hash_map
Best regards,
Alexandru Savescu
|
|
|
|
|
Hello,
I tested the folowing things:
1. With a CView based MDI project, I added a second document with a CFormView. Butr when I run it and choose the new document I get a debug/assert in viewform.cpp.
Next I tried so that both docs have views based on CFormView. Same problem. View1 shows fine, view2 asserts. ANy ideas?
Thanks,
ns
|
|
|
|
|
Hi! I've just created a button by code, and i would like to have in the same class where it has been created, its control member variable, what i have is :
botao->Create("Cancel", WS_CHILD|WS_VISIBLE, CRect(10, y+120, 60, y+170), this, 1232123);
I use this ast argumento to give it a name and then i edited Resource.h and write : #define IDNB_TESTE 1232123, 'assigning' that id number to a name, which i would use in DDX:
DDX_Control(pDX, IDNB_TESTE, m_teste);
then i tried to use the m_teste variable, but i kept receiving errors, what ave i done wrong? How can i do this?
Thank you for your time
|
|
|
|
|
I found it, i had just to had BS_PUSHBUTTON and process the ON_BT_CLICKED message with the id i had chose to the function.
Thank you the same
|
|
|
|
|
Hi,
I use Visual C++ 6.0 and have problem working with MS Access Database 2000:
a) After I created a database table with MS Access 1997, then later if I use Class Wizard (in Visual C++ 6.0) to add a new class with DAO option (CdaoRecordSet or CDaoRecordView) ... there is no problem, every thing working fine!
b) But if I created a database table with MS Access 2000, then when I add a new class with DAO option (CdaoRecordSet or CDaoRecordView) ... it did not allow and said "unrecognized format"
- I did add this code: AfxGetModuleState()->m_dwVersion = 0x0601; to let Visual C++ recognize new driver, I also download "DaoPatch.dll" and put it into \Program Files\MS Visual Studio\VC98\Setup\1033 & \Program Files\MS Visual Studio\Common\Wizzard98 ... still had the same problem!
- Even I tried to update with Microsoft Visual Studio 6.0 Service Pack 5 that claimed improvement some problem with DAO 3.6 files (Dao header & cpp files... the result is the same!
*) I know it should work, but I do not know how to do it? Can any one help me?
I am really appreciate it! Thanks.
Thanh Chau
|
|
|
|
|
You need the latest version of MDAC. You can probably get it off the MS web site.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
I found this function:
LRESULT CMainFrame::OnTestMessageLParam(WPARAM wParam, LPARAM lParam)
used by some sample code. But when I went to "add windows messsage handler" in the mainframe class context menu I didnt see any thing like wm_message or something. SO where is this function coming from and what does it respond to? Shouldnt it have been in the context menu?
|
|
|
|
|
If you are using MFC you most surely have the source code also. Search the MFC src directory for OnTestMessageLParam .
|
|
|
|
|
Hi There,
Does anybody know the best way of rendering a 2d circle outline onto 3d device of a known number of pixels readius? I've tried rendering it by making vertex buffer with some points arranged in a circle drawn in close proximity to the camera, but it seems to be a bit of a convoluted way of going about it... Does anybody know a better way of overlaying 2d shapes into the buffer?
Thanks for you help...
With time we live, with money we spend!
Joel Holdsworth
|
|
|
|
|
Draw a plain circle on a bitmap and the use it as a texture.
Since this is also how it's done in OpenGL you might have a look at e.g. "NeHe Productions" or opengl.org (note, you might get biased against proprietary API's using free information like this :->).
|
|
|
|
|
My app will have only two MDI docs and two views (one for each). No new views or windows can be created. I want to show (or spawn) doc2 and view2 in response to a buttonclick on view1. Then after the user has finished entering data in view2, I want to click a button, get rid of view2 (destroy or hide), and show view1 (updated) again. How do I go about doing this?
I am working on how to get view1 the info returned by view2 in a separate thread.Thanks so much,
ns
|
|
|
|
|
I added classes for the second doc and view and added the template. Wouldnt compile. I compared it with a successful example with uses CViews , not CFormViews. My CFOrmView view code differed from the CView code,: the constructor wasnt argumentless and was public, and there was no dyncraete staement. SO I moved the declaration of my cosntructor to protected and added the dyncreate statement, but still wont compile. What am I doing wrong or not doing?
Thank you!
|
|
|
|
|
ns wrote:
but still wont compile
what are the error messages???
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
Thanks so much for the interest. I used class wizard to make my view and doc files (the second doc)
The example with CView that works has:
from .h
protected:
CMDIBillView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CMDIBillView)
and from .cpp
IMPLEMENT_DYNCREATE(CMDIBillView, CView)
CMDIBillView::CMDIBillView()
{
}
I just noticed that:
The implement line was missing in my view code (CFOrmView based)
so I added
IMPLEMENT_DYNCREATE(CMDIKVView, CFormView)
plus the other changes noted below. Now only 1 error:
C:\Trainer\mditalk\MDIKVView.cpp(16) : error C2512: 'CMDIKVView' : no appropriate default constructor available
My second view class has the following relevant code (I moved the constructor to protected and added dyncreate - it didnt show up by default as is does in a CView based example I made)
From the .h file:
protected:
CMDIKVView(CWnd* pParent /*=NULL*/); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CMDIKVView)
From the cpp file:
CMDIKVView::CMDIKVView(CWnd* pParent /*=NULL*/)
: CDialog(CMDIKVView::IDD, pParent)
{
//{{AFX_DATA_INIT(CMDIKVView)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
The example with CView that works has:
from .h
protected:
CMDIBillView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CMDIBillView)
and from .cpp
IMPLEMENT_DYNCREATE(CMDIBillView, CView)
CMDIBillView::CMDIBillView()
{
}
I just noticed that:
The implement line was missing in my view code (CFOrmView based)
so I added
IMPLEMENT_DYNCREATE(CMDIKVView, CFormView)
plus the other changes noted below. Now only 1 error:
C:\Trainer\mditalk\MDIKVView.cpp(16) : error C2512: 'CMDIKVView' : no appropriate default constructor available
|
|
|
|
|
Well,
It turns out that my second document I accidentally derived from CDIalog, whereas I wanted CFormView. So things are okay regarding my troubles with that. Which brings me to the question: Does one not make a view derived from CDialog in MDI?
|
|
|
|
|