|
cheers Pankaj
it looks like the link you gave me has what I need to do! (I did look at ADO before but all the examples talked about JET, which meant I didnt delve too far into it)
many thanks,
Andy
|
|
|
|
|
mcsherry wrote:
I did look at ADO before but all the examples talked about JET, which meant I didnt delve too far into it)
The Microsoft Access Databases uses the JET engine, so you cannot avoid this. You will have to interact with the JET engine to communicate with the database no matter what method you use. Maybe your boss was taking about not using a specific technology (MFC's DAO classes, for example)?
I Dream of Absolute Zero
|
|
|
|
|
2) should read
2)I can't #include <afxdb.h> and <afxdao.h> as these cause compilation errors with the main library the software is built on. (the error is to do with GetTickCount, which is MFC even though its not used in the program and no methods exist in our code called GetTickCount!)
|
|
|
|
|
Sorry, replied above before reading this ammendment.
Those include files are MFC's database classes CDAOXXXX. ADO is definitely the way to go. You can find one or two very good ADO wrapper classes right here in CP to use in your project.
I Dream of Absolute Zero
|
|
|
|
|
About GetTickCount errors, maybe it has to do with the macro GetCurrentTime which is defined as GetTickCount for backward compatibility.
If that's the case, simply undefing the macro will do the job.
|
|
|
|
|
How to disable all ASSERTs in Debug mode?I am using a memory leak tool called as entrek, and the recurring ASSERTs make it difficult to execute the program. (I am getting timecore.cpp asserts every 1 sec as there is one thread which sets the timer every 1 sec, i haven't checked the details as to y these asserts r coming)
This is very urgent. Any help appreciated.
|
|
|
|
|
If you are using some memory leak prog thats great, but if you are getting asserts then your prog is not even ready to pass the first test of "good program" then comes the memory leak test.
I would suggest to find and rectify the problem that is causing the assert.
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
Thnks ,
I have no idea and time to look into the ASSERT problem. Its in timecore.cpp.
I need to send this urgently.
|
|
|
|
|
write in your code:
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
The message will be written to the debugger's output window.
|
|
|
|
|
Hello,
in my VC++ application, I use ODBC dbf files driver to access a file.dbf.
In my code, I open the data the database connection (it works normaly).
Then I do my request : "SELECT Field1,Field2 FROM tab WHERE (Field0 = value)".
Here, I recieve an ODBC error message "Impossible de trouver le fichier memo xBase Demande", in english it can be traduced by "impossible to find the requested xBase memo file" ....
1) what does ODBC want to say with this message ?
2) what is the cause of this message
What is strange : I just open the file dbf with Excel (no modification in file, no save of file, just open to view the content), I restart my VC++ application and the Select returns me some rows ... just as the fact to have the file opened makes it work ...
I tried several times and without Excel, I have the msg, with excell it works ...
Any idea appreciated
DD
|
|
|
|
|
I am using VC++ 6.0. I used the app wizard to create an MFC application without socket support, but later found that socket communications was necessary. I manually added the call to 'AfxInitSocket()' to the application's 'InitInstance()' method. Since doing this the entire CDocument based document class is reported as a memory leak when socket communications takes place. The document class is properly deleted when the socket subsystem is not used.
Did I miss a step when I added the socket support?
|
|
|
|
|
You did correct in initializing the socket routines, so there's nothing initially wrong with adding socket support.
Could the error lie in the way you use the sockets ? Naturally, you could post a bit more information of the way you use them. I haven't noticed any memory leaks in the communications applications I have used, but I also generally just send and receive raw data. Remember that if you send a CDocument-derived object, the receiving end must also be aware of the new object's size. So send the size first, reserve memory for the object, then fill the designated memory area with the data.
Post more details, such as a piece of code from your communication routines, and perhaps we can help you more.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I use a CSocket class object for very simple communications. This frees me from attending to synchronization
on the sockets. A CSocketFile object is created and attached and CArchive object for reading and wtiting are
created and attached to the file.
// clear the file/archive pointers
m_pFile = NULL;
m_pArchiveIn = NULL;
m_pArchiveOut = NULL;
// if the socket is created and connected
if (m_Socket.Create() && m_Socket.Connect(m_csServer, (UINT)m_nPort))
{
// build the file
m_pFile = new CSocketFile(&m_Socket);
// and archives for communication
m_pArchiveIn = new CArchive(m_pFile,CArchive::load);
m_pArchiveOut = new CArchive(m_pFile,CArchive::store);
// set the obejct status to ok
m_Status = PCCO_NO_ERROR;
}
There is usually no problem here.
An HTTP POST message is formatted and sent over the socket.
// write the passed message to the socket
// as an http post message
CString csString;
csString.Format("POST /cgi-bin/%s.cgi HTTP/1.1\r\n", csApp);
m_pArchiveOut->WriteString(csString);
m_pArchiveOut->WriteString("Accept: text/html\r\n");
m_pArchiveOut->WriteString("User-Agent: Mozilla/4.0\r\n");
m_pArchiveOut->WriteString("Content-Type: application/x-www-form-urlencoded\r\n");
csString.Format("Host %s:%d\r\n", m_csServer, m_nPort);
m_pArchiveOut->WriteString(csString);
m_pArchiveOut->WriteString("Cache-Control: no-cache\r\n");
csString.Format("Content-Length: %d\r\n\r\n", csMessage.GetLength());
m_pArchiveOut->WriteString(csString);
m_pArchiveOut->WriteString(csMessage);
m_pArchiveOut->Flush();
The response is received in the form of an HTML page, and parsed.
// if we're here we have data
CString csApproval,
csTransID,
csCvv2Resp,
csAccountNo,
csInput; // POST message header inputs
char *pszPage = NULL; // the HTML page response
bool bError = false;
// read the POST header
m_pArchiveIn->ReadString(csInput);
// if there is no problem (code 200)
if (csInput.Find("200") > -1)
{
// read the content length
m_pArchiveIn->ReadString(csInput);
// read the length value from the string
csInput = csInput.Right(csInput.GetLength() - csInput.Find(':') - 1);
// and store as an integer
int nPageLen = atoi(csInput);
// and read the type
m_pArchiveIn->ReadString(csInput);
// read the blank line before the data
m_pArchiveIn->ReadString(csInput);
// get room for the HTML page
// if there is memory for the page
if (pszPage = new char[nPageLen + 1])
// read the HTML page response
m_pArchiveIn->ReadString(pszPage, nPageLen);
.The string pointer 'pszPage' is deleted if allocated. The snippet includes only the socket communications.
Thanks!!!
|
|
|
|
|
There doesn't seem to be any coding issues here, as long as you remembered to clear the archive and CSocketFile objects and call Close on the socket object.
You said that your CDocument-derived object reports a memory leak at this point ? Could it be that you've forgotten something back there ?
Your last chance would be to invest to some memory validator tool and run your code through step-by-step, especially in the point where the memory leak is considered. If nothing else fits the pattern, then this may be also a bug in the VC++ debugger. I've encoutered such a problem once before in my coding, when I created a view without a document object. It reported that the document object was leaking memory even though it was never created.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Does any body know the control type that pops up when highlight text and right click. I want to include clipboard functionality into my program and want it to look like standard MS programs.
|
|
|
|
|
hello pals, i'm new guy to this forum. im doing project in VC++ and also new to VC++. interestingly i have to develop a small scripting language using vC++ for performing graphical functions.
that is creating a small graphical package using VC++. consider the user doen't know anything about the syntax for performing graphics using VC++. we are defining a new set of our control with syntax and one looping statements to perform grp.o/p
1. suppose user writes a code for displaying a multicircle on the screen.but he doesn'nt know anything about the VC++ circle ...etc.
but using our script he can perform his job.
ex:
# start
drawcirle 123,233
.
.
.
# end
but our VC++ program should acts as an interpreter to convert our defined scrts to appr..vc++ graphical routines.that is developing a compiler using a VC++ compiler.
pleassse help me to work out my module given by my guide.Atleast suggest me where i have to start and in which part of VC++ i have to concentrate.
First he told me spec it out the project, but i do know what to spec it out.
my module include,
#1. defining a few datatypes,graphical scripts and anyone looping stmt.
2. using (module #1) the programmer writes his code.
3. We have to execute the code by interpreting to VC++ grahical function.
i posted in many forums, but one of my friend gave this site..
with regards,
Mahesh
|
|
|
|
|
If you are trying to build a complete scripting engine, you're in too deep.
I'd suggest that you first attempt to create a simple program that reads text files and draws graphic according to those. When you succeed in this, just implement text-editing and row-manipulation routines to your program and you have precisely what you need.
For a start, first create the specification. Decide what graphic routines you are planning to use: Win32, DirectX, OpenGL or what. Then decide what drawing routines your scripting language supports: can you draw a circle, a rectangle, a triangle or all of these ?
If you resort to Win32, then your task becomes even simpler: just create a parsing function that is able to intepret the scripting language's commands. Then the intepreter calls the appropriate Win32 routine to draw the requested graphic. As the program itself will worry about creating the target window, pencils, brushes etc, then the parser should be quite simple.
For more complex object support, just add a more logic to the parser and make it call several drawing routines if required.
If you are new to Windows-programming, then I suggest purchasing a book by Charles Petzold called Programming Windows. This book is "The Bible" of Windows-programming: it explains every little detail deeply enough for anyone familiar with C/C++ to understand.
If you're out of luck and can't get this book, there are several articles available here at CodeProject. Here is a good place to start looking http://www.codeproject.com/gdi/[^]
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Dear Developers!
Recently I've been looking for a tool that will do the subj, I've found some links, the software was a bit diffenrent, but it's price was about $699!
Yeah I smiled too That's why I decided to create my own tool.
The main problem is I don't know how to save in SWF(it's Macromedia Flash) format. That's why I'm asking for assist in creating of new and of course *free* tool. Please join.
Thanks a lot. ths@smtp.ru
P.S.: The tool will be a virtual printer driver(it's ready) that will convert
the data you send to print to an swf file. That how you can publish it on your web site without using any soft that costs.
P.S.S: Please don't give me links to a ready to use software. As I've mentioned it will be public, source free stuff!
Thanks again. Bye.
|
|
|
|
|
You can find the designation of the SWF format from this link: http://www.half-serious.com/swf/format/[^]
Additionally, here is a link to a working download of Flash Format SDK, released by MacroMedia. It is an SDK used to read and write SWF files: http://www.softlookup.com/preview/dis6903.html[^]
Hope these will get you started.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi...
There are some problems which I am not able to solve. They are
consider an MDI application....with three child windows open in it....with three buttons on each child window in the toolbar....actually this is a static MDI application...with three child windows initially....
1. The three child windows in the file should be toggable. Suppose if I click on the 1 in the toolbar then the child window should be shown and if I click it once again then it should be hidden not destroyed.
2. The three child windows should be made dockable like in VC++ the windows are dockable.
3. There are three views in this file. One for Bitmap, second for Color table and the last one for Text. For bitmap and data I don't seem to face any problem but for the color table, I will have to display the colors that are present in the bitmap image in tabular form. The tabular columns consists of three columns one for Index, second for colors in the bitmap and the third for the RGB values of each individual color. But I don't know how to do that.
Please help me regarding the above.
Regards,
Ruchit Sharma. R
|
|
|
|
|
Ok, I may be guessing on some of this.
1. Create your flotaing windows with a base class of CControlBar, and make them members of CMainFrame with the frame as their parents. You need to call EnableDocking etc on them like you do for toolbars
2. To show and hide, map the toolbar button in the mainframe and have code such as:
ShowControlBar(&m_myBar, (m_myBarGetStyle() & WS_VISIBLE) == 0, FALSE);
to toggle it on / off
Not sure about the colour stuff.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
Thanks for the reply....
But if i make my base class as CControlBar will i be able to handle text and bitmap...Please do u have any other idea for this problem other than using the CControlBar....plz suggest some ideas....
Thanking you,
Ruchit Sharma. R
|
|
|
|
|
Hi
I have to m/c with windows. Both are connected through internet. I want to transfer automatically some file from 1 m/c to the other.
I have VC++ 6 with me. Can anybody help me in this regard.
I have done networking programming in unix with c. but I do not have programming exp with windows.
So it will b of real help for me if any of u can guide me in writing a ftp server and client in C for windows.
Thanks
|
|
|
|
|
|
ClassLibImImageBj error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in libcmt.lib(typinfo.obj)<br />
ClassLibImImageBj error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in libcmt.lib(typinfo.obj)<br />
ClassLibImImageBj error LNK2005: _strncmp already defined in libcmt.lib(strncmp.obj)
My executable which runs the static library is
C++ - code generation - Multithreaded Debug
My static library project setting is
C++ - code generation - Multithreaded Debug DLL
Any hints?
I have try to ignore some libraries but it turns up that I am missing some linkage to some symbols etc.
thank you
Sonork 100.41263:Anthony_Yio
|
|
|
|