Problem after adding control

I've added a button to one of my dialogs and now the program crashes
in DoDataExchange():

DDX_Control(pDX, IDC_MY_BUTTON, m_MyButton);

if I use GetDlgItem() it crashes.  What gives?

Thanks,
Drew




0
5/4/2006 9:14:42 PM
vc.mfc 33608 articles. 0 followers. Follow

10 Replies
1310 Views

Similar Articles

[PageSpeed] 27

Drew wrote:

> I've added a button to one of my dialogs and now the program crashes
> in DoDataExchange():
> 
> DDX_Control(pDX, IDC_MY_BUTTON, m_MyButton);
> 
> if I use GetDlgItem() it crashes.  What gives?
> 
> Thanks,
> Drew
> 

Drew:

Crashes? Crashes? What kind of description is this? How can anybody help 
you with just this information?

David Wilkinson

0
no-reply8010 (1791)
5/4/2006 9:35:00 PM
Oops.  Not exactly accurate.  The DDX_Control statement actually
generates "An unsupported operation was attempted." The GetDlgItem
is throwing an exception (Access Violation).

Thanks,
Drew

"David Wilkinson" <no-reply@effisols.com> wrote in message 
news:eHrpRK8bGHA.628@TK2MSFTNGP04.phx.gbl...
> Drew wrote:
>
>> I've added a button to one of my dialogs and now the program crashes
>> in DoDataExchange():
>>
>> DDX_Control(pDX, IDC_MY_BUTTON, m_MyButton);
>>
>> if I use GetDlgItem() it crashes.  What gives?
>>
>> Thanks,
>> Drew
>>
>
> Drew:
>
> Crashes? Crashes? What kind of description is this? How can anybody help 
> you with just this information?
>
> David Wilkinson
> 


0
5/4/2006 10:27:09 PM
Drew wrote:

> Oops.  Not exactly accurate.  The DDX_Control statement actually
> generates "An unsupported operation was attempted." The GetDlgItem
> is throwing an exception (Access Violation).
> 
> Thanks,
> Drew
> 
> "David Wilkinson" <no-reply@effisols.com> wrote in message 
> news:eHrpRK8bGHA.628@TK2MSFTNGP04.phx.gbl...
> 
>>Drew wrote:
>>
>>
>>>I've added a button to one of my dialogs and now the program crashes
>>>in DoDataExchange():
>>>
>>>DDX_Control(pDX, IDC_MY_BUTTON, m_MyButton);
>>>
>>>if I use GetDlgItem() it crashes.  What gives?
>>>
>>>Thanks,
>>>Drew
>>>
>>
>>Drew:
>>
>>Crashes? Crashes? What kind of description is this? How can anybody help 
>>you with just this information?
>>
>>David Wilkinson
>>

DRew:

Are you sure that IDC_MY_BUTTON is the ID of a button control on your 
dialog template?

David Wilkinson
0
no-reply8010 (1791)
5/5/2006 2:49:27 AM
There's no such thing as a "crash".  There is ALWAYS (catch this: ALWAYS) a very
informative message which has a lot of characters displayed in it, and without telling us
what these little sequences of characters are, we are not going to be able to diagnose
exactly what went wrong.

You might indicate you had an ASSERT failure, which tells you a few little details llike
the file and line on which it occurs, and you might indicate what the stack backtrace was,
or you might indicate you had a exception thrown, and you might indicate what the stack
backtrace was, or in some other way actually DESCRIBE THE PROBLEM.  But never, ever,
report that a "crash" occured; all you said here was "my program doesn't work, please tell
me what I did wrong".  What you did wrong was fail to report what went wrong.
					joe

On Thu, 4 May 2006 16:14:42 -0500, "Drew" <drew.nospam.myers@esrd.com> wrote:

>I've added a button to one of my dialogs and now the program crashes
>in DoDataExchange():
>
>DDX_Control(pDX, IDC_MY_BUTTON, m_MyButton);
>
>if I use GetDlgItem() it crashes.  What gives?
>
>Thanks,
>Drew
>
>
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
-- 
NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth
0
newcomer (15975)
5/5/2006 3:07:08 AM
"David Wilkinson" <no-reply@effisols.com> wrote in message 
news:Od4z%235%23bGHA.3388@TK2MSFTNGP05.phx.gbl...
> Drew wrote:
>
>> Oops.  Not exactly accurate.  The DDX_Control statement actually
>> generates "An unsupported operation was attempted." The GetDlgItem
>> is throwing an exception (Access Violation).
>>
>> Thanks,
>> Drew
>>
>> "David Wilkinson" <no-reply@effisols.com> wrote in message 
>> news:eHrpRK8bGHA.628@TK2MSFTNGP04.phx.gbl...
>>
>>>Drew wrote:
>>>
>>>
>>>>I've added a button to one of my dialogs and now the program crashes
>>>>in DoDataExchange():
>>>>
>>>>DDX_Control(pDX, IDC_MY_BUTTON, m_MyButton);
>>>>
>>>>if I use GetDlgItem() it crashes.  What gives?
>>>>
>>>>Thanks,
>>>>Drew
>>>>
>>>
> DRew:
>
> Are you sure that IDC_MY_BUTTON is the ID of a button control on your 
> dialog template?
>
> David Wilkinson

David,

Yes, I'm sure.  Also, my resources are in a seperate DLL if that helps any.

Thanks,
Drew 


0
5/5/2006 7:22:24 PM
> Yes, I'm sure.  Also, my resources are in a seperate DLL if that helps
any.
>


What does the stack look like when you get access violation. Its possible
you are using a variable which is null, which in this would be GetDlgItem
returning NULL and you are using it any way. Show your line of offending
code along with call to GetDlgItem. Also, what sort of DLL is this? Regular
or Extension?

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com



0
ajaykalra (6842)
5/5/2006 8:28:01 PM
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
news:%23DSBcJIcGHA.1516@TK2MSFTNGP05.phx.gbl...
>> Yes, I'm sure.  Also, my resources are in a seperate DLL if that helps
> any.
>>
>
>
> What does the stack look like when you get access violation. Its possible
> you are using a variable which is null, which in this would be GetDlgItem
> returning NULL and you are using it any way.

You're right GetDlgItem returns NULL and I do a ShowWindow() so that
explains the crash.

>Show your line of offending
> code along with call to GetDlgItem. Also, what sort of DLL is this? 
> Regular
> or Extension?

This is an Extension DLL.  Now why is GetDlgItem returning NULL?

Thanks,
Drew

>
> --
> Ajay Kalra [MVP - VC++]
> ajaykalra@yahoo.com
>
>
> 


0
5/5/2006 11:39:31 PM
Because a control by that ID does not exist in the window you are querying?  That's the
most likely cause...
				joe

On Fri, 5 May 2006 18:39:31 -0500, "Drew" <drew.nospam.myers@esrd.com> wrote:

>
>"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
>news:%23DSBcJIcGHA.1516@TK2MSFTNGP05.phx.gbl...
>>> Yes, I'm sure.  Also, my resources are in a seperate DLL if that helps
>> any.
>>>
>>
>>
>> What does the stack look like when you get access violation. Its possible
>> you are using a variable which is null, which in this would be GetDlgItem
>> returning NULL and you are using it any way.
>
>You're right GetDlgItem returns NULL and I do a ShowWindow() so that
>explains the crash.
>
>>Show your line of offending
>> code along with call to GetDlgItem. Also, what sort of DLL is this? 
>> Regular
>> or Extension?
>
>This is an Extension DLL.  Now why is GetDlgItem returning NULL?
>
>Thanks,
>Drew
>
>>
>> --
>> Ajay Kalra [MVP - VC++]
>> ajaykalra@yahoo.com
>>
>>
>> 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
-- 
NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth
0
newcomer (15975)
5/7/2006 5:00:07 PM
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:ur9s5297s5ki9bh9mrada0l0vc2sh5h7b8@4ax.com...
> Because a control by that ID does not exist in the window you are 
> querying?  That's the
> most likely cause...
> joe
>

Would that it were that simple.  CButton added using the resource editor,
ID copied from resource DLL project's resource.h to main project's 
resource.h.
Used ClassWizard to add member variable to class (which fails in 
DoDataExchange()
with "Unsupported operation..." message).  I guess I'll try deleting all 
project
generated files (NCB, etc..) and rebuild all although I think I've tried 
that already.
Also, I have verified the ID is listed in the dialog template in the .rc 
file.

Thanks,
Drew 


0
5/8/2006 4:54:30 PM
Never mind.  I'm an idiot.  DLL was being loaded from a remote machine
that had not been updated.  I need to pay more attention to the Output 
window.

Sorry for wasting your time. Thanks,
Drew

"Drew" <drew.nospam.myers@esrd.com> wrote in message 
news:OkBETAscGHA.1324@TK2MSFTNGP04.phx.gbl...
>
> "Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
> news:ur9s5297s5ki9bh9mrada0l0vc2sh5h7b8@4ax.com...
>> Because a control by that ID does not exist in the window you are 
>> querying?  That's the
>> most likely cause...
>> joe
>>
>
> Would that it were that simple.  CButton added using the resource editor,
> ID copied from resource DLL project's resource.h to main project's 
> resource.h.
> Used ClassWizard to add member variable to class (which fails in 
> DoDataExchange()
> with "Unsupported operation..." message).  I guess I'll try deleting all 
> project
> generated files (NCB, etc..) and rebuild all although I think I've tried 
> that already.
> Also, I have verified the ID is listed in the dialog template in the .rc 
> file.
>
> Thanks,
> Drew
> 


0
5/8/2006 5:16:24 PM
Reply:

Similar Artilces:

Slow Response time after server move to AD
I've recently moved my Windows 2003 Server running GP 8.0 from a stand alone server on a Novell network to a member server in Active Directory. The response time from client computers has slowed drastically. It also ocurred when the clients were part of Active Directory and the sevrer was still a stand alone (workgroup). Does anyone have any thoughts on what might be slowing the response time of GP, primarily on customer screens. Thanks! Ben DeGennaro ...

Controlling printed records when report bound to multiple tables
I created a report that uses the control from a form to generate a report based on that record's primary key. This form also has a subform which has relationships tied to the primary key for record identification and is linked to the main table. When preview the report the data from the subform either does not show up in the preview when using the filter [control]=[form]![control].[value] or makes multiple copies of the report equal to the number of entries in the subform's table. Is there any way around this? I have tried queries but have not found a way to use a f...

Problems with reading date/time format from SQL server
Helo! I made a pivot table. I get data from external source - SQL server. On of the columns is date/time type. For some reason unknown to me, Exce doesn't read this dates correctly. Instead of dots between months an days it puts little squares .. ?!? I opened the same file on m coworkers comp. and it works just fine. If anyone has already encountered this and knows how to fix it .. plase reply. thnx j -- Message posted from http://www.ExcelForum.com There may be some difficulties getting external data properly into Excel. If not done correctly you cannot use the data in formulae e....

Outlook Web Access attachment problem
We have a program that will generate a .snp file and then email it to whatever recipient it needs to go to. If they receive the email in Outlook it will allow them to open the file properly with the Snapshot viewer. However, if they go to the same email in OWA and try to save the attachment, it attempts to save it as an .mdb file. Why would OWA ignore the original extension and try to give it a different one? "Joe Giddings" <j_nospam_giddings@thehammocksource.com> wrote in news:jI9gd.11726$ta5.6952@newsread3.news.atl.earthlink.net: > We have a program that will genera...

mail sending problem
Hi , I am very new in the exchange server just now I have deployed Microsoft Exchange Server 2003 at my organization now i have some problem in that . I am able to send mail outside the domain except yahoo .whenever I am sending mail from my exchange mail id to any yahoo mail id it is showing me mail has been sent but on yahoo id it is not delivering even I am not getting the DFR, second I wants to know that can we take the backup of single mail box (boxs) and please tell me step by step how can we take backup (at least the location ) Thanks in Advance Madi The most probable reason is t...

Windows Welcome Screen Login Looping Problem
Up until now no startup problems whatsoever with my system. Today, I press the start button and it boots fine to the Windows' Welcome Screen. When I click on my account icon (no password ever entered) it tries to login (I see my desktop for about 4-5 seconds) but it comes back to the same Windows' Welcome Screen after about 5-10 seconds. My significant other also has an account icon and when she tries to login from the welcome screen she can't get pass the screen either and gets the same 5-10 seconds looping problem that happens to me. System specs: Dell Deminsio...

Incoming mail server problem
I use supanet for the internet and recently had to clear off a load of viruses and worms from my computer. Computer is clean now. I've run up to date spybot. adaware and cleaned all viruses with Mcaffee internet security as well as running stinger. Sasser, and W32 pate.b were included. Have also completed all windows updates. Everything is working fine now except my email. When I restart the computer my incoming mail server keeps changing from pop.supanet.com to a strange number. 9eg 17.02.01.10 or something similar) It also changes the user name from 3612 to 3612@supanet.com (It adds su...

Problems performing a restore to a SAN drive
We recently move our message stores to SAN. I've tried to perform a restore to a recovery storage group on the SAN and am not able to do it. We use Ultrabac as our backup application, but I've tried NTBackup also and am getting the following errors in the App logs: Information Store (3576) Callback function call ErrESECBRestoreGetDestination ended with error 0xC7FE1F42 Database not found. and Failed to find a database to restore to from the Microsoft Active Directory. Storage Group specified on the backup media is e0d4e0af-f91a-490d-9b40-47e27b9fb714. Database speci...

Adding a Bank to Money 2002's database
Can I add an online bank to Money 2002's database or must it be added by Microsoft?? In microsoft.public.money, Rob wrote: >Can I add an online bank to Money 2002's database or must >it be added by Microsoft?? That must be done by Microsoft working together with your bank. However you can use any bank you choose for your own file. Just select the (Not Listed) choice when you create the account. Then in the Account Details, enter the address, web site URL, etc. ...

XMLA .NET connection problem
Hi, After install msxml 4.0 and XMLASDK 1.1, i proceed to configure the datasource.xml file, as follow: <DataSource> <DataSourceName>FoodMart 2000</DataSourceName> <DataSourceDescription>Microsoft Analysis Server 2000 on local machine</DataSourceDescription> <URL>http://localhost/xmla/msxisapi.dll</URL> <DataSourceInfo>Provider=MSOLAP.2;Data Source=md001144</DataSourceInfo> <ProviderName>Microsoft XML for Analysis</ProviderName> <ProviderType> <TDP/> <MDP/> <DMP/> </ProviderType>...

Mail is queued after adding 2nd server
I was hoping someone might have some insight into this issue. I've just completed adding a 2nd server to my first site. All mail between the two servers is getting queued; doesn't matter which server it originates from. Mail to the original server from the internet as well as auto generated emails is still functioning correctly. We're running Exchg 2003 SP2 and Win2k3 on both servers. I've also gone through the Best Practices and fixed the minor issues it listed. Thanks, Chris Can you telnet to port 25 from each server successfully? Are the servers located in the same su...

Help on adding values to a bar chart
Hello, Here is my problem. I currently have a bar chart that has 8 X-axis bars. I need to add 2 more to the X-axis. The labels for the x-axis are based on cells within another spreadsheet, but are not consecutive cells, they are spread apart. So when I go to add the two more cells, I can only add one. When I click on the second cell to add it to the list, all of the previous cells get unselected. I have even tried to manually add these two values in. Is there a limit to how many values can be on the X-axis? Please Help!!! Thanks. To select non-consecutive cells: select first cell, h...

Publisher 2003
I'm attempting to print a calendar and I keep getting the message, "Cannot load the printer driver." I have no idea what that means other than I'm unable to print my calendar. Anyone have any ideas? I get the same message whenever I try to print a card I've created. HELP! -- The computer has been chucked out the picture window and the birds are nesting in it. *sigh* Merrie wrote: > I'm attempting to print a calendar and I keep getting the message, > "Cannot load the printer driver." I have no idea what that means > other than I'm una...

Problems with DATE data type
Hi!!! I've got a little problem with the next macro in Excel. The problem is that I must look for some information in a data bas using as filter a specific day an hour in the year. I get the date and the hour using a form and then the macro calle "Busqueda" receives the value. I've programmed the macro using MSQuery just to see the necessary cod and the problem has appeared when I've tried to include the para called "Dia" in the SQL code. I've tried using " & Dia & " but it doesn't work and I don't know ho to include my param...

Active X control in Excel 2003
I have is=nstalled a pen pad on my pc which usies an active x control in Excel to enable me to draw in it. Everytime I start Excel it asks me if I was to run this Active X control. Is there a way of stopping it asking me every time? Thanks Shane Excel 2003, Windows XP home Hi, I think if you lowered your security level, it wouldn't ask, but I wouldn't recommend doing so. It prevents unauthorized and possibly dangerous macros from running and causing damage. I'd put up with the nuisance. jeff >-----Original Message----- >I have is=nstalled a pen pad on my pc which usi...

Reinstall problem
I have a CRM 1.2 MSDN installation. I ran add/remove programs to un-install. Everything seemed to uninstall just fine. I then ran the installer again to reinstall. I wanted to use the existing database. I select the: "Connect to an existing database" options, click next then select my SQL server from the list. I then get a message: Setup could not find any valid Microsoft CRM databases on the server you have specified. You must select a different server. I know the databases are there. I can see them in enterprise manager. The system was working fine except for ...

Problem w/ Task Manager
This is a multi-part message in MIME format. ------=_NextPart_000_0006_01CB4835.4C042E00 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am running a laptop with WIndows XP SP3. I am not sure what changed or = happened but my task manager now only shows the processes tab. The tabs = are mising for me to change views as well as the title bar for my task = manager windo and the menu bar i also gone. How can I correct it? Thanks ------=_NextPart_000_0006_01CB4835.4C042E00 Content-Type: text/html; charset="iso-8...

Mac problems opening excel files when connected to two windows shares
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I'm noticing a strange problem when I try to open excel files when I connect to a second windows server share. I'm getting a cannot open excel file error. Not sitting at my work mac computer at the moment so not quite sure that was the exact error. <br><br>This error is occuring on both leopard and snow leopard with Office 2008 for mac. <br><br>The two windows servers are being connected to by smb://server1/common and smb://server2/common. <br><br>If i connect to each one i...

An error number : 424 problem
I'm having trouble with an attachment field. On a report I can see the picture and the filename of the selected attachent properly. Now in a SQL UPDATE string that i'm making I always get the error 424 Object required. Here is the line where it happens : 'mySQL = mySQL + ", scan_g = " & prn_du_pied_g.FileName scan_g is a Text field prn_du_pied_g is an attachment All I want to do is to use the filename of the attchment. How do I solve this Thank you for the help -- Eric "ericb" <eric@b.com> wrote in message news:9A...

Adding Users
I was just reading the implementation guide and I have a quick question. After installing CRM 3.0, do all the users in the AD that have the ability to log into the domain, have access to use CRM? or is there a certain group that they need to be added too or do they need to be added into CRM? Thanks, JN answered in other group -- Matt Parks MVP - Microsoft CRM "JN" <jnsimex@rogers.com> wrote in message news:uqxcsESSGHA.1948@TK2MSFTNGP09.phx.gbl... I was just reading the implementation guide and I have a quick question. After installing CRM 3.0, do all the users in th...

Mail and Catalog merge problems
This is a two part question. The first part concerns an error and the second part is seeking advice. First the error: I am trying to create a data source for use in a catalog merge. No matter what method I use, even using "Create Address List" from Publisher's Tools menu, I get an error dialog saying: "The operation cannot be completed because of dialog or database engine failures. Please try again later." What causes this and how do I correct it? I would like to be able to connect to a SQL 2005 database for merge data. Now the request for advice: I am cr...

Publisher 2007 printing problem
I have a publisher file 6x4 template. When I try to print on a 4x6 photo paper instead of 1 page landscape it prints 2 in portrait. No mater what I do seems to change this. First, File Print setup Size: 4x6 Portrait OK Then, File Page Setup Special Size Width: 6" Height: 4" Landscape OK Build your project Save File Print -- Don - Publisher 2000� Vancouver, USA "tomincolorado" <tomincolorado@discussions.microsoft.com> wrote in message news:7CC2310B-E932-459A-94A2-45E96D530FC7@microsoft.com... >I have a publisher file 6x4 ...

Wireless ad-hoc network
1/ Since ad-hoc connection dies when not in use (even for few minutes), is it possible to set up a more permanent connection just using Vista (no router/hardware) 2/ Last time I set up ad hoc network Vista did not prompt me to share the internet connection and subsequently it didn't - I checked under every stone but couldn't find an option to share my internet connection (despite setting it up 4-5 times) - Where does option this live in ad hoc connection? this was how I used to share internet connection in Win XP 1. Open Network Connections on the host computer. ...

CAsyncSocket::Reveive() problem
I am receiving some data in my application through the Receive() function TCHAR data[100]; int read=serv1.Receive(data,100); so here the data received in the data buffer is always half the data sent from the other side like if i send "AAAAAAAA" then i receive only "AAAA" which is half of the sent. what is the problem? "nexolite" <nexolite@discussions.microsoft.com> wrote in message news:47AD1B40-9CBD-4BC1-B196-B2A26EA1C908@microsoft.com... >I am receiving some data in my application through the Receive() function > > TCHAR data[100]; > ...

After crash problem
Hello, We've just recovered our crashed exchange 2003 server. All is working fine except for one user that keeps on getting prompted to enter his domain user name and password. Even when the information is entered, the user still does not get access to her inbox folder which resides in the server. The user has no problem accessing her email using OWA. Any ideas> Thank you in advance. Check the following things: Outlook repeatedly prompting for credentials - First possibility was primary DNS suffix on either the client or the server being wrong - make sure it matches the DNS ...