wrong character set? #2

I have a MFC dll project. When the dll is called, a dialog is poped
up.

CDialog_Dll::CDialog_Dll(CParameters *parmList, CWnd* pParent /
*=3DNULL*/)
	: CDialog(CDialog_Dll::IDD, pParent)
{
	m_parmList =3D parmList;
	Create (IDD_DIALOG_MAIN,pParent);//Set break point 1 here
	ShowWindow (SW_SHOW);//Set break point 2 here
}//Set break point 3 here

BOOL CDialog_Dll::OnInitDialog()
{
	CDialog::OnInitDialog();

	return true;//Set break point 4 here
}

All above works fine. CParameters is cumtomer class.

The problem is coming when I click a button called 'load':

void CDialog_Dll::OnBnClickedButtonLoad()
{
	CFileDialog dlg(TRUE);//Set break point 5 here
                 ...
}

I set 5 break points. And add m_parmList  to watch window.

At break point 1 - 4, m_parmList  show the RIGHT value:

+		m_parmList	0x000ee94c {m_XPMFile=3D"C:\PROGRAM FILES\CoolInstrument
\MyInstr.xpm" m_Init_File=3D"C:\PROGRAM FILES\CoolInstrument\DSD"
m_Measurement_Parameter_List=3D"SNM=3Dxxx
SFM=3Dsolid sample
NAM=3Dprobe a
PTH=3DC:\Program Files\CoolInstrument\Data
CIT=3D5.000000
NSS=3D1
TDL=3D47
BGA=3D0
BDT=3D1000
CTD=3D0
ACL=3D1
SCA=3D0
BGT=3D1
CSR=3D0
SSC=3D0
ACL=3D1
AEX=3D0
AFR=3D0
SRC=3Dabc
OPF=3D100%
APT=3D12345
CLM=3D1
RES=3D1
SRG=3D1
GRT=3D1
GRN=3Dabcde .	CParameters *

But at break point 5, I got:

+		m_parmList	0x000ee94c {m_XPMFile=3D"=C3=90=90=90=90=90=90=90=FF=FF=FF=FF"=

m_Init_File=3D"=E9=B6OE=FE=FF=90=90=90=90=90h=B8" m_Measurement_Parameter_Li=
st=3D"=0C" ...}
CParameters *

What is WRONG?

The dialog is simple - only 1 'load' button.

Is looks wrong character come back. But why it is correct at first 4
breakpoints?

Could anybody help me out? Thanks.
0
yqin_99 (193)
1/25/2008 9:38:08 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
611 Views

Similar Articles

[PageSpeed] 46

"kathy" <yqin_99@yahoo.com> ha scritto nel messaggio 
news:914e34ca-0924-4536-af7a-bbd023175a80@e6g2000prf.googlegroups.com...

> All above works fine. CParameters is cumtomer class.
[...]
> The problem is coming when I click a button called 'load':
[...]
> void CDialog_Dll::OnBnClickedButtonLoad()
> {
> CFileDialog dlg(TRUE);//Set break point 5 here
>                 ...
> }
[...]
> What is WRONG?

It is like "psychic" debugging...

There could be several causes: you may have some code (e.g. some buffer 
ovverrun, some raw C array, some bad pointer) that is corrupting the heap...
You may be misusing the CParameters pointer...

It could be interested to see also the definition of CParameters class. Do 
you use CString there?
Or do you have any raw C arrays? If so, you should pay attention to array 
bounds, or better using a robust container class like CArray or std::vector.

Moreoever, in general, if you are allocating objects from a DLL, you should 
also free them from the same DLL (you can pass pointers to other DLLs or 
EXE, but creation and destruction should be done in the same module).

I'm sorry I can't give better help, but without seeing some source code it 
is hard for me.

Giovanni



0
1/25/2008 9:53:01 PM
>CDialog_Dll::CDialog_Dll(CParameters *parmList, CWnd* pParent /
>*=NULL*/)
>	: CDialog(CDialog_Dll::IDD, pParent)
>{
>	m_parmList = parmList;
>...
>I set 5 break points. And add m_parmList  to watch window.
>
>At break point 1 - 4, m_parmList  show the RIGHT value:
>
>+		m_parmList	0x000ee94c {m_XPMFile="C:\PROGRAM FILES\CoolInstrument
>...
>But at break point 5, I got:
>
>+		m_parmList	0x000ee94c {m_XPMFile="�???????����"

>What is WRONG?

I'd guess that the object that the pointer is pointing at no longer
exists. I'd further guess that you've allocated it as a local (stack)
variable and passed a pointer to it when you instantiate Dialog_dll?

If that is the case, because you have a modeless dialog, execution
will have returned from CDialog_Dll::CDialog_Dll and the object will
have been destroyed.

Of course, I may be totally wrong as you've not shown that code.

Dave
0
davidl7375 (2060)
1/25/2008 9:54:31 PM
Reply:

Similar Artilces:

wrong email address sends
How do I make Outlook send the correct email address and not a business account that I do not want going out with my messages I'm not sure if I understand your question correctly -- are you asking how to force Outlook to send messages through one account rather than another? If so, I need some more information from you before I can answer: What version of Outlook are you using, and if 98 or 2000, what mail support mode? If you're not sure, look at the second line of Help | About Microsoft Outlook -- it should say "Internet Mail Only" or "Corporate/Workgroup". ...

Emails shown with wrong date in overview-screen?
hello NG, i have the following problem: i have made a constellation of folders in witch i sort my incoming and outgoing mail to. now i have found the following phaenomenon: in one of these folders i see a bunch of mail (sent by myself) witch all seem to be sent on the same date, 15. december 2004. but in reality this is the wrong date, they have been sent over a long period reaching back even until 2001. if i doubleklick on the mail and view it the correct date is shown. only in the "overview-screen" where all the mails are listed, the date is shown wrong. what can i do about ...

What wrong with sumproduct function?
I would like to sum all numbers, which match following conditions, =SUMPRODUCT(($B$1816:$B$2400=$A2402),(C$1816:C$2400<0),(C$1816:C$2400)) press ctrl + shift + enter but it returns zero, and I have checked it, zero should not be the result. Does anyone have any suggestions what wrong with sumproduct function? Thanks in advance for any suggestions Eric 1. Sumproduct is not an array function. Use Enter, not Ctrl-Shift-Enter. 2. You must convert false/trues to numbers. One way: =SUMPRODUCT(($B$1816:$B$2400=$A2402)*(C$1816:C$2400<0)*(C$1816:C$2400)) Regards, Fred "E...

Transfering Emails #2
Can some kind soul tell me how to copy the contents of my Inbox on Microsoft Office Outlook 2007 to Outlook Express? It's got me stumped! Thanks Patch wrote: > Can some kind soul tell me how to copy the contents of my Inbox on Microsoft > Office Outlook 2007 to Outlook Express? It's got me stumped! > > > Thanks > > In OE do File-Import. Outlook (not Express) must be set as default Email client. "Gordon" <gbplinux@gmail.com.invalid> wrote in message news:63b6mvF26nourU1@mid.individual.net... > Patch wrote: >> Can some kind ...

Error When set form at Startup
I have made a copy of a working db -to shrink its size- everything goes well until I set the User ID form at the Startup. Then when I close and re-open I get this error in the File List Module- It is a compile Error- invalid use of New Keyword. I am confused as it works when it is set this way before I copied the Tables, queries, and modules into the new blank database. Help!! I have to shrink this for our customer. It stops on the DIM of the conflict table. Option Compare Database Public Function MyResolver() Dim Db As Database Dim Td As TableDef Dim Confli...

Setting Up Payroll
How do I set up employee information and deductions to write payroll checks with out using the paycheck service that money offers? I just want to print a few checks and it keeps telling me there are no accounts set up???? Money is designed as a personal finance program or for a one man company. If you have employees you really need a "real" finance program. -- Regards Bob Peel, Microsoft MVP - Money For UK tips & fixes see http://support.microsoft.com/default.aspx?scid=fh;EN-GB;mny. For wishes or suggestions see http://register.microsoft.com/mswish/suggestion.asp...

Switch Identity #2
I was told that I can switch Identities in Outlook 2003. I can't seem to figure out how to add and then switch email identities. I know you can in Outlook Express, but I am certain that I can't seem to do it in Outlook. Help... Outlook does not use Identities, it uses profiles. Go to Control Panel, Mail Icon and open it. Select the Show Profiles option and add your profile from there. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be delete...

Excel: printing with hiddent columns #2
My worksheet with hidden columns in the middle should fit easily on one sheet, but print preview shows a page break after the hidden columns. Apparently the width of the hidden columns was included. How do I get the print setup to ignore the hidden columns when determining page breaks? ...

How to set up for out of office
I need to know how to setup my e-mail account in Outlook 2000 to let people know that I will be out of the office for an extended period of time when they e-mail me. I don't want to have to send a broadcast e-mail to my contacts in my address book. New and potential clients aren't in there and I don't want them to think I'm ignoring them. Thank you, Gary McCormack See if the information on the following page helps: http://www.slipstick.com/rules/autoreply.htm -- Jocelyn Fiorello MVP - Outlook *** Messages sent to my e-mail address will NOT be answered -- please repl...

XML updating,querying question #2
I use a TreeView WebControl Menu which i installed from microsoft. But the TreeView XML that can be loaded with the Webcontrol is very specific.For example (The root as to be TREENODES!!):- <?xml version="1.0" encoding="utf-8"?> <TREENODES> <TreeNode Text="Contracts"> <TreeNode Text="Contract Pads" NavigateUrl="a.aspx" target="_blank"/> <TreeNode Text="Points Deduction Report" NavigateUrl="a.aspx" target="_blank"/> <TreeNode Text="" NavigateUrl=...

Wrong Date/Wrong amount
In the Money 2004 check register it reports the last download date as well as the balance in the top left corner. The only problem is that it is totally wrong. It reports some bogus amount with a "downloaded" date of 10/9/2003. It is quite stubborn as nothing seems to affect it. Does anyone have any idea of how to correct this? Dirty Harry Harry Calahan wrote: > *In the Money 2004 check register it reports the last download dat > as > well as the balance in the top left corner. The only problem i > that > it is totally wrong. It reports some bogus amount wi...

Fiscal Year Settings
Hi, We are getting the following error message when trying to acceess the Fiscal Year Settings; "An error has occured, For more information, contact your systems administrator" The installation is on an SBS 2003 so the Reporting Server and SQL DB are on the same machine, Reporting Server seems to be running OK we can access it OK both from with the CRM app and from http://localhost/reports. Any ideas? Thanks Justin Hi, Found the answer http://support.microsoft.com/kb/921394 Rgds Justin Justin wrote: > Hi, > > We are getting the following error message when trying t...

Help please
I screwed something up and need help big-time. Somehow the default position of the cursor when I start a new document - or Outlook mail message - is in the right center part of the page. In fact, if I even open a document, it's formatted with everything scrunched over to the right. I can backspace and get the cursor to the right and it's not a big problem on documents with simple formatting, but for some complex documents, simply backspacing makes the formatting even worse. HELP PLEASW. -- rpbilleaud For a start, see http://word.mvps.org/FAQs/AppErrors/BlankDo...

damaged tracking logs #2
Running Exchange 5.5 SP3 on Windows NT 4.0 SP6a. I've recently started getting following error messages when attempting to search the tracking logs via the admin console: "The message tracking log file '\\<SERVERNAME>\Tracking.log\<DATE>.log' has a damaged entry at line <LINENUMBER>. Do you want to continue reading the file and attempt to recover the remaining entries?" <DATE> and <LINENUMBER> are always different. If I click YES, the search continues, at least until another error message appears. If I click NO, I get another dialog box s...

How do i set up specific fields in Outlook contacts
I want to find out how I go about setting up an additional field in my outlook contacts. (2003 edition) I am looking to put a "home address" field underneath the business address field and I cannot figure out how to create this. I know that I can switch the business to home or other, but would really like to create some new fields here. Can someone tell me how? Thanks, Matt ...

Lost all inbox and contacts etc when removed server #2
I found the outlook.ost file. Can I reimpost this to Outlook? Can I somehow set it or use it as the "personal data files" that the outlook dialog box requested? I dont get why I was able to access the contacts emails etc after I disconnected the exchange server BUT only after I removed the exchange server did it all disappear. Not sure how I was meant to continue this thread so I copied the previous question, comment and listed it as a new post -- hope this it ok protocol. Also someone else had recommended that I re-engage the server but it is neither listed nor frank...

Set up simple inventory counting sheet GP 8.0
I want to count several of the raw material components at one small warehouse we have. Is there a way I can use the stock counting programs in GP 8.0 without assigning all the items selected in my site/component list to be counted in some specific shedule. I set up my first count sheet and the program forced me to put in a scheduled number of days for the list of item/site list before I could print out the count sheet. THe stock count cycle assignment window required a number of days entry to be entered. You can setup a count sheet by simply adding the items manually to the count. ...

'server busy' timeout settings
Hi, I'm calling a fucntion in VB from MFC (using COM). Sometimes, the function takes a while, and I'm getting the 'server busy' message. How can I set the timeout so I won't get this message? Does anyone know? Regards, Ram. "Ram Baruch" <ram_ba_ruch@newsgroups.nospam> wrote in message news:<#zdxmoeWEHA.500@TK2MSFTNGP09.phx.gbl>... > Hi, > I'm calling a fucntion in VB from MFC (using COM). Sometimes, the function > takes a while, and I'm getting the 'server busy' message. How can I set the > timeout so I won't get thi...

how to set admin privilege
How to set admin privilege for a windows user In windows7 i login to a user which admin right. when i use CreateFile to open a device say hard drive then it's fail. While if i login to administrator and use CreateFile then it's succeed. So i think i need to set admin privilege to current user. Please suggest. >In windows7 i login to a user which admin right. when i use CreateFile to >open a device say hard drive then it's fail. While if i login to >administrator and use CreateFile then it's succeed. It sounds to me as though your application need...

What's going wrong in Outlook 2003?
Hello, When I installed the new Office 2003, I had no problems with Outlook 2003. I received and send mails whenever I want. A few days later, I get a message from outlook that Outlook could not make a connection with the server of my provider to get my mail on my computerb (I didn't change any settings!). I checked all my settings and there are good (I checked the mailserversettings, ports, etc) but the result is still the same: Outlook cannot make a connection with the mailserver. After that, I called my provider to ask them what to do. They told me that I must remove all the ...

Set all folders to AutoArchive
All the Outlook folders on my system are set to "Do not archive items in this folder". Since I have hundreds of folders it is a tedious process going to each folder and changing the Properties|AutoArchive setting to "Archive items in this folder using the default settings". Is there a way to set all the folders to "Archive items in this folder using the default settings" without having to do each one separately? Also, is there a way to set up Outlook so all new folders are created with the AutoArchive set to "Archive items in this folder using the d...

What Am I Doing Wrong?
The application I'm modifying is a fairly standard example of an MFC MDI app. There are several CToolBars created in MainFrm.cpp. The code to respond to the buttons on these toolbars is in the View.cpp file. One of these toolbars I modified to contain a slider. I derived a new class, CViewToolBar, from CToolBar and modified it to have a slider. I'm having problems with two major things: the correct way to include the new class information so that MainFrm knows about it to create the new toolbar, and how to get the view to respond to WM_HSCROLL messages from the slider. I had ...

wrong number in cell
In XP PRO & Excel 2002 I have a cell formated as General and unlocked. I try to enter a number { 08607100 } I hit enter and it changes to { 8607100 } no matter what I try it. This is another example of a problem in a cell I enter { 03E2 } hit enter and it changes to { 3.00E+02 }. Is there some bug in certain cells or with excel 2002 or is there some setting I am missing? Help -- Thanks MK pipco wrote: > In XP PRO & Excel 2002 I have a cell formated as General and unlocked. I > try to enter a number { 08607100 } I hit enter and it changes to { 8607100 &g...

sorting alphanumerical characters
Hi, I want to do an index for molecular formulas. Normally I import a file (.csv) and I have one column (text) containing: C3H2 C12H6F3 C12H6FO2 C6H12NO2 C10H5F3 and so on I would like to do a sorting in which C atoms are first sorted from 1-~, then H from 1 -~ and then alphabetical order of the rest of the elements(i.e F,N,O)in ascending order. The final list should look like: C3H2 C6H12NO2 C10H5F3 C12H6FO2 C12H6F3 Any suggestions please? Thank you Luminita Luminita, You can use a macro to sort chemical formulas. The version I've written will sort a list starting in cell A1, extending ...

Dialog editor for 2 languages?
I maintain a MFC application with a big number of dialogs and two UI-languages and every time I change a dialog in one language I have to do it again in the other language. It is tedious work with the standard dialog editor. I never want layout and tab-order to differ between languages - I always make the dialogs large enough for the "worst" language. I would like to buy a Resource Editor that let me change the dialog layout for all languages simultaneously and easily switch edit-language for text. Do anybody here know if such a Resource Editor exists, and where I can buy i...