|
I tried your code as-is and it compiled and ran fine. What is the problem you are seeing? It must be something you are doing after the dialog box is displayed that is causing an access violation at shutdown.
|
|
|
|
|
Hi folks,
i have a problem with CString definitions; in a class ( Non-MFC class) i defined some private CString members. Now I added one more CString member; but when I was storing information to another CString member the value of the new defined CString held the same information. Looking at these members while debigging I saw that both members have the same address - how is that possible? I deleted one of the members and made new defintions - nothing changed....
What's going wrong?
I am using MS VC++ 6.0 with Service Pack 5
Thanks in advance
Michael Delvos
CEO Central European International Virtual Airways
http://www.fs2002.de
|
|
|
|
|
Show us the class definition.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
The member m_sBarcode and m_sFileNameLogo share the same address; more -whenever a define a CString within a member function, it has - immediately after its contruction - the same address and content as m_sFilenameLogo...
// Bon.h: Schnittstelle für die Klasse CBon.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BON_H__1DEC1370_A4CA_4906_9AB1_C7F7D679BEC0__INCLUDED_)
#define AFX_BON_H__1DEC1370_A4CA_4906_9AB1_C7F7D679BEC0__INCLUDED_
#include "Printer.h" // Hinzugefügt von der Klassenansicht
#include "extern.h"
#include "winspool.h"
#include "Registry.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CBon
{
public:
long m_JobId;
bool Initialize();
bool Initialize( CString p_sPrinterName );
bool CheckEanDataBon( long p_lSize, LPTSTR p_lpData );
void SetTestPrint();
bool BonDrucken();
bool BonAufbereiten();
bool SendDataBon( CString p_sData );
char GetImmediateStatusByte();
int GetImmediateStatus();
bool HasPrinterError();
long GetJobId( void );
CBon();
virtual ~CBon();
private:
CString m_sBarcode;
CString m_sFileNameLogo;
CPrinter m_Printer;
CStringArray m_sZeilen;
CString m_sData;
CPoint m_PrintPos;
int m_iLinesPrinted;
bool m_fTestPrint;
DWORD m_dwLogoDruck;
void GetWords( CString, CStringArray* );
bool ZeileAnalysieren( CString p_sZeile );
bool ZeileAufbereiten( CString p_sZeile );
int GetNumericValue( CString p_sPara );
CString SetSteuercode( CString p_sSteuerCode, CString p_sData );
CString GetSteuercode( DWORD p_dwSize, LPTSTR p_szData );
void CreateJobId( void );
};
#endif // !defined(AFX_BON_H__1DEC1370_A4CA_4906_9AB1_C7F7D679BEC0__INCLUDED_)
Michael Delvos
CEO Central European International Virtual Airways
http://www.fs2002.de
|
|
|
|
|
So if you store a string to m_sBarcode , m_sFileNameLogo gets changed as well?
Have you tried doing a rebuild-all? Sometimes the incremental compilation gets a little screwed.
Other than that, I can't think of any reasons why it would be doing this...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Its probably just CStrings reference counting going a bit screwy. VC++ 7 changed the CString class from a reference counted string to derive from a template char array to get away from some buggy elements, I'm guessing this is one of them.
|
|
|
|
|
What does the following produce?
CBon::CBon()
{
TRACE("m_sBarcode = %#x\n", &m_sBarcode);
TRACE("m_sFileNameLogo = %#x\n", &m_sFileNameLogo);
}
|
|
|
|
|
Well - thx to you all - I think it was a buggy project file or something like that - i put my classes into a new project and it works
Thx for your help guys
Michael Delvos
CEO Central European International Virtual Airways
http://www.fs2002.de
|
|
|
|
|
I need XModem class for Visual C++.
|
|
|
|
|
A Google search for "XModem class for Visual C++" works well for me.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Is there any API in VC++, that when called by the main thread, the main thread should wait until all the threads created by this main thread exit.
|
|
|
|
|
Have you looked at WaitForSingleObject() and related functions?
|
|
|
|
|
WaitForMultipleObjects()
Check out MSDN.
|
|
|
|
|
Hello, Sir:
I have a touble with CPU test. And I am working CPU Test. That test item have MCA ID Test, Numeric Coprocessor Test and FPU Test. Because I know a little about those. Can somepople help me? Maybe you have some about those. Can you help me? Or you can tell me some article about those? Thank in advance.
|
|
|
|
|
Use the CPUID assembler command to get the CPU features. Then:
HansonDavid wrote:
MCA ID Test
dwCPUFeatures & 0x00004000
HansonDavid wrote:
Numeric Coprocessor Test
dwCPUFeatures & 0x00000001
HansonDavid wrote:
Or you can tell me some article about those?
For sure! http://www.codeproject.com/system/camel.asp[^].
Hope that helps
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
They both write a byte 0xAD to the port 0x64
|
|
|
|
|
Right
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hello, Sir:
Thanks your reply. Now i have some about that. But i have some trouble with the FPU. I have studyed IA-32 Intel® Architecture Software Developer’s Manual, and knew some about FPU. I need test CPU FPU function, it include "FPU Exception Test", "FPU Control Register Test", "FPU Tag word Register Test" and "FPU Calculation Test". And I don't how can test those really. Do you know how to "test" such FPU fuction. Do you have a example about those, or give me some advice? I am helpless, waiting...
|
|
|
|
|
Sorry, I don't know.
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hello,
I'm developing a program that does some intensive computation(arithmetic coding) on a block of data, say 2MB in size. It tooks longer time to finish. If I implement the same computation using 2 threads and split the input into two equal halves(1MB), one for each thread, does the computation time decrease? please help me.
Is there any way to speed up the computation using threads?
I have only one processor, P4 1.7 GHz non HT. I'm using windows 2000.
The computation is directly proportional to the size of data(i.e if it took 5 seconds for 3MB input, then it will take 10 seconds for 6MB input data).
regards
Ramesh
|
|
|
|
|
No, on a single-processor system, the context switching overhead will most likely hurt your performance, not improve it. However, being able to split the data and parallelize the process as an option is a nice feature for those who do have multi-processor systems.
- Mike
|
|
|
|
|
On a single processor it would, if anything, be a little slower because the OS has to switch between threads (though not noticably). If the intensive computation is affecting things like clicking a button in the app, and general app response time then it would be worth sticking the whole process in its own thread and let the apps own thread just deal with message processing, thats probably the best solution (in effect there would be two threads anyway, one for your exe thats instantiated upon load, and the other is your 'worker' thread).
|
|
|
|
|
Hi everyone
When I use Visual C++ 6 to build a Doc/View application the final application will have an icon it its title bar. This icon is 16 x 16 pixel and looks exactly as the corresponding 16 x 16 pixel version of the icon I can edit in the resource editor.
On the other side when I build a dialog based application it will have an icon in its title bar, too, it is 16 x 16 pixel in size, too, but it does not look the same as the icon I can edit in the resource editor. I guess it is "shrunken" from the 32 x 32 pixel version of the icon in the resource editor, nevertheless it is not what I want because this "shrunken" icon looks distorted.
A screenshot demonstrating this behaviour:
http://www.teeteehaa.de/pictures/applicationicon.gif
Can anbody explain me the reason for this and how to prevent it?
Thanks,
Matthias "T.T.H." Grobe
|
|
|
|
|
I'm guessing here, but its probably a subtle change microsoft made to distinguish MFC dialogs from MFC apps. You could just use the dialog editor to copy the icon you want and paste it into the dialog project? Hope this helps.
|
|
|
|
|
It may be the 16x16 vs. 32x32 thing that's ailing you.
|
|
|
|