|
hi,
i programed sql6.5 db browser with vc6 & ado. but when i query too much records,
ado exception occured when recordset open. can you help me?
and:
i have tried to access sql6.5 with db_library, and when i query lots of records, program
is ok. why? i wanna know more about db_library, where i can get some articles and samples?
thank you.
|
|
|
|
|
HI,
How can I display to the screen the content data of the thread while working? just like monitoring, for example I create a thread that will make a loop from 1 to 100 and every time the loop increment it display on the screen(CView, CScrollview... etc) what number the loop is.
The thread is created using afxBeginthread.
I will appriciate your help guys!
-delz
|
|
|
|
|
Hi,
You can use the standard ways of displaying information on the screen. The only difference is that you must put this code into the critical section, so you will not try to access the same dialog object simultaneously.
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Hi again,
I'm new in VC++ ,I try this one but I get Debug Assertion fail.
UINT My_Thread(LPVOID pParam) {
int i
CDC DC;
CString a;
for(i=0;i<3;i++) {
_itoa(i, a, 10);
DC.TextOut(10,10,a);
}
}
|
|
|
|
|
Hi all:
This is about copying files over a network. My program has its own copy routine, using CreateFile, ReadFile, and WriteFile. It works perfectly for local files, and perfectly for files on a network, if they are public (i.e. no passwords), but sometimes doesn't work if the file is password protected. My application uses WNetAddConnection2 and prompts for a password if it doesn't work. Even when I type in the correct password, some of the files in the shared folder copy, some don't at all (a zero byte file is created) or only partially copy. Does anyone have any idea what causes this?
Here's a snippet:
while ( ReadFile(hSrcFile,..,&dwBytesRead,...)
{
WriteFile(hSrc,...,dwBytesRead,...);
// WriteFile uses the dwBytesRead from ReadFile to determine how much it should write
}
Anyone have a clue as to what could be wrong?
|
|
|
|
|
I have a small routine for switching the current view in an MFC SDI application that works fine in Win95/98. when I run it under Win2000 it does not work. The return codes indicate success, but the window never gets repainted with my new view. Any one run into this yet? Here is the code:
BOOL CMainFrame::SwitchView(eViews eView)
{
CView* pOldView = GetActiveView();
CView* pNewView;
switch(eView)
{
case eView1:
pNewView = (CView*) new CView1;
break;
default:
pNewView = (CView*) new CView2;
break;
}
CCreateContext context;
context.m_pCurrentDoc = pOldView->GetDocument();
pNewView->Create(NULL, NULL, 0L, CFrameWnd::rectDefault, this, eView, &context);
pNewView->OnInitialUpdate();
SetActiveView(pNewView);
pNewView->ShowWindow(SW_SHOW);
pOldView->ShowWindow(SW_HIDE);
::SetWindowWord(pNewView->m_hWnd, GWL_ID, AFX_IDW_PANE_FIRST);
RecalcLayout();
delete pOldView;
m_eCurrentView = eView;
return TRUE;
}
|
|
|
|
|
First of all excuse my english, I'm just a begginer using it.
I have received a class that allows me to dock windows on a MDI/SDI frame. Using this class I have developed a Dev. Studio like application, that has tabs at it's bottom in a docking window.
In some of those tabs I have placed a CEdit that don't allow the user to enter data (Read Only), but I would like to have those ones in a white background.
I don't know how to make it, your help would be very useful.
Note:
the controls are created flyby, there is not a dialog where they are placed.
Thank you in advance.
|
|
|
|
|
Subject: Memory leak
Category: C++
Hi,
Does any one know why the following code creates a memory leak. It's a console application that uses the MFC library.
#include <iostream>
#include <afx.h>
using namespace std;
void main()
{
CMemoryState before,after,diff;
before.Checkpoint();
cout << 6 << endl;
after.Checkpoint();
if (diff.Difference(before,after)) {
fprintf(stdout,"memory leaked\n");
diff.DumpStatistics();
}
}
The problem is in the line: 'cout << 6 << endl;' because of the '6' if I replace the above line with 'cout << "Hello world" << endl;' there is no memory leak.
Thanks,
Shai
|
|
|
|
|
Don't know if this is a solution, but I think the 'leak' is either a problem related to how the CRT debug methods deal with the templated code in the std implementation - or it also be simply that the memory is not freed until the call to _free_crt after main exits.
This code localizes the problem to the std implementation - if you use iostream.h, there are no leaks reported. (Note this code also eliminates the MFC in the original code)
#include < iostream.h >
#include "crtdbg.h"
int main()
{
{
cout << 9 << endl;
}
_CrtDumpMemoryLeaks();
return 0;
}
I don't think there is a real leak here, but must admit to not seeing the whole picture. I think this code isolates the problem, though.
|
|
|
|
|
Hi, I need to get icon which related to a file extension without having real file.
For example, getting the icon which associate with .avi or .wav,
but without having local file which I can use ShGetFileInfo on it.
Is there a way to get this info except getting it directly from the registry ?
Thanks
yariv
|
|
|
|
|
You can use SHGetFileInfo() for this, just include SHGFI_USEFILEATTRIBUTES in the uFlags parameter, and pass a filename of "x.avi" or "x.wav" or whatever extension.
|
|
|
|
|
Hi,
please have a look at this small code snippet and tell a beginner, why the output is different in debug and release build:
int main(int argc, char* argv[])
{
printf("Entering try-catch block...\n");
try {
int one = 1;
int null = 0;
printf("Calling crash statement...\n");
int result = one / null;
}
catch (...) {
printf("Inside catch block. Handling error!");
}
return 0;
}
Debug output:
Entering try-catch block...
Calling crash statement...
Inside catch block. Handling error!
Release output:
Entering try-catch block...
Calling crash statement...
What's going on here???
Matthias
|
|
|
|
|
Ooo - nice one!
The problem stems from the compilers optimization code. If you enable debug info for the release build you'll see that the assignment for result is never executed. Change the optimizations for the release build to none and the code is executed.
Cool. I've read of optimization problems before, but this one's amazing...
|
|
|
|
|
Further notes...
Maybe amazing is the wrong word, but there is a grey area here.
The optimizer removes the code because the var result is never used. It could be argued that the compiler is wrong to overlook the side effect of the expression one / null, but that side effect is not a c++ exception - its a processor trap which the OS decides to pass on to the program - trapping these with catch(...) is murky ground.
Interesting - when you modify the code to make use of result, causing the compiler to compile the assignment, you get a warning C4723: potential divide by 0. So, while it may not be core C++, the compiler does know of the possible side effects of the expression.
Building with warning level 4 provides more clues, but stops short of the warning that would be most informative - i.e. that the code has been removed.
It does give an ureachable code warning for the catch(...), but it gives that for the case where the assignment is used and compiled as well. Makes sense, since no C++ exception is thrown.
I guess the simplest solution is to give in and reference result somewhere in the try block. Better might be to avoid this type of code and test null before attempting the divison.
|
|
|
|
|
I used in a programm the ButtonST Class from Codeproject...
this button class uses the SetCapture method to draw the
button ( win98 style ). now i initiated in the program that
the user must press a accerelator key ( F1 till F11 ) to
switch to another view.... Its an SDI application developed
under Visual C++ 6.0 ( no SP ). The acckey calls a function
OnKeyF1Pressed()... but when the mouse is over a buttonST
OnKeyF1Pressed won't be called..... I think there's a
problem with the buttonST ( esspecially with SetCapture ).
I tried to called RemoveCapture() when the button is drawed
but that isn't very fine because the buttonst isn't drawn
completely but the view is switched.
hope that someone will help me
BEST REGARDS
ingo eberhardt
SEC
|
|
|
|
|
I am looking for a resource editor component (Freware, Shareware or
commercial) that allows users dynamically select controls from a palette,
draw them on a layer, position them and manage their properties. The
mechanism should be Visio® like.
Thanks
|
|
|
|
|
Hello,
I'm trying to find the best way to use the common tooltip control but with the possibility to have diferent fonts like bold, normal and italic in it.
My first idea was to try the custom draw support of the tooltip control but that does not enable you to have different fonts in one and the same tooltip.
Ok, I thought lets try it with owner draw, but the thing is I'm not sure if that is possible or supported with the tooltip common control.
Is there anyone out there who can give me an explanation how to do this the best way? Is owner drawing supported by the tooltip common control?
My aim is to support an editor for a house made language with the "Parameter Info" feature like the one in VC++, so whenever the next possible argument is entered the tooltip should show the next argument highlighted like with a bold font, simple but...
Andreas.
|
|
|
|
|
I haven't tried this myself, but I would think you could owner-draw the entire tooltip when the NM_CUSTOMDRAW message arrives. The NMCUSTOMDRAW struct has a RECT member that tells you the RECT of the control.
|
|
|
|
|
If you decide to go the path of a owner drawn control then you are welcome to use my Extended Tooltip as a base. It only allows a single font, but maybe there is scope to extend it to provide RTF capabilites within the tooltip window that would provide what you want. A lot of work, I guess - but it would be cool
|
|
|
|
|
I am writing an application for a customer and they have selected that F10 and it's variations (Ctl, Alt, Shift) bring up different windows.
Now I know that F10 is a System key used for Menu's and such, but I have tried WM_SYSCOMMAND and WM_SYSKEYDOWN to no avail. Here is my code for OnSysCommand:
void CMyDialog::OnSysCommand(UINT nID, LPARAM lParam)
{
if (nID == SC_KEYMENU)
{
UINT nKey = VK_F10;
OnFunctionKey(&nKey);
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
This works fine...but it works whether the user presses F10 or just Alt, which I don't want. So the basic question is
"Has anybody used F10 for something other than a menu initializer?"
Thanks
Chris Mancini
|
|
|
|
|
Hi
I did this using
OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
..
if (VK_F10 == nChar)
..
and it works fine.
Use ::GetKeyState to find out about Alt, Ctrl and so on
|
|
|
|
|
How to make a replication through ODBC in MS Access?
|
|
|
|
|
I have a problem with DevStudio Sp3 running under Win2K. The attach to process dialog doesn't show any processes! Does anyone else have such a problem?
Jignesh
|
|
|
|
|
Found the problem..
See http://support.microsoft.com/support/kb/articles/Q235/4/34.ASP
|
|
|
|
|
One more developers web site is almost ready. Here is discussion board
www.mindcracker.com/forum
|
|
|
|