|
1. Did you try to debug it from IDE?
2. Did you try to build a release version?
I vote pro drink
|
|
|
|
|
F5 Helps
Cheers!!!!
Carlos Antollini.
|
|
|
|
|
Hi, I press F5 to build/compile it, but still receive the same error.
How can I build a release version?
I try to debug it, but I just don't know the proper step. I'm really new to this kind of stuff, please help...
|
|
|
|
|
You use F9 to put a breakpoint in your code, then when you push F5 you will go into debug mode, and the program will stop at your break point. Use F10 to execute a line of code at a time until you find the line that is crashing.
In this case, you just need to go to the line in question of the file in question. It's in MFC and the code looks like this:
if (hWndCtrl == NULL)
{
TRACE1("Error: no data exchange control with ID 0x%04X.\n", nIDC);
ASSERT(FALSE);
AfxThrowNotSupportedException();
}
What it is saying is that you used to have a control in your dialog, you deleted it, and there is still code there trying to link to that control. Get rid of the code related to the control you deleted and it will work.
In future I recommend if an error comes up telling you a file and line number you have a look to see where it crashes so you can figure out why. The TRACE line would also have output this error into your output window, you should read what it say when a program crashes.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
Assumming dlgdata.cpp is something you've written, what does line 43 say?
The best thing to do is to put a breakpoint somewhere and see what you're passing to the particular function...
Cheers, Richard.
|
|
|
|
|
Press Retry, then select View|Debug windows|Call stack. YOu'll see that assert failed inside CDataExchange::PrepareCtrl. Look deeper on the stack to find out who called PrepareCtrl. I have a strong feeling that you have DDX_something on a control with nontexisting identifier inside CYourDialog::DoDataExchange.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
i have just encountered the same problem...
if you had any luck in solving the problem. please do tell.
|
|
|
|
|
I tried "insert activex control" in VC, but can't find the PowerPoint control.
Did you anyone once solve the problem? THank you very very much.
tag
|
|
|
|
|
I haven't heard of any PowerPoint ActiveX control but I have used PowerPoint and other Office apps as out of process COM objects.
|
|
|
|
|
Could you show me some sample code? I 'm a beginner of COM. Thank you
very much.
xiang
|
|
|
|
|
Do you Know the name of that OCX??
Carlos Antollini.
|
|
|
|
|
I'm working through 'Creating Lightweight controls with ATL', and am learning about collections. So I work through the example and create a COM server that enumerates files in a directory. Then I attempt to create an MFC project (dialog based ) that will use this server. The line:
IFindFilesPtr pIFind(__uuidof(FindFiles));
crashes every time. So I change my #import line to
#import "../FileLister/Filelister.tlb" no_namespace named_guids
and try
IFindFilesPtr pIFind(IID_IFindFiles);
Crashes every time. So I try
IFindFilesPtr pIFind;
pIFind.CreateInstance(CLSID_FindFiles);
This does not crash, but pIFind is *always* NULL. Now if I run the example program provided in the book, all works fine. It is an ATL based program and it has no UI, it uses ATLTRACE to output the files in the directory. I have scoured stdafx and the file in question for #includes I might need ( initguid and comdef have made their way into my file, do I need them ? ) but I cannot get the same object to work in my MFC based dialog as it does in the example ATL program.
Can anyone suggest what the problem might be ? My code in the first instance ( the first line that crashed every time ) is a carbon copy of what the working program does.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
Try searching here
http://discuss.microsoft.com/archives/atl.html
|
|
|
|
|
Ok I am just starting out in c++ and I had a question -
I have been making some tiny programs where a little guy runs around - cheesy yeah. The way I've been printing out him and the playing field is basically a 2-d array filled with the map and him... Then in DOS evertime a player moves I just reprint out the whole thing. Now I THINK I am ready to use graphic to make it all a little better....
..The thing is I've been downloading all these free libraries/includes/tutorials/etc.. but when it comes time to compile them I ALWAYS get errors! These are the author's original files I think maybe I am going about putting their files into my library/include/whatever the wrong way. What I have been doing is taking all their H files and just putting them into my include. Is this wrong? Is my compiler jacked? Should I leave it intact and perhaps add the unzipped folder (containing their source and h files) to my linkers directories? What the hell am I doing wrong!
Thanks for any help in advance. I am crying over this because I could have had like 5 games done in the time I have spent on this issue. You can email me at ontheritz@yahoo.com
Mike
OH PS Is there a way besides getch() to directly read keystrokes? Like I want to be able to know when the key is pressed as well as released. Is it somehow sneaking into the keyboard buffer and altering it yourself or what? How about the joystick/etc?
|
|
|
|
|
Usually libraries will involve one or more .h files in a directory. When C++ is looking for a .h file invoked by an include with <xxxx.h> it searchs a list of directories which is set somewhere in the options stuff. An include with quotes checks the source directory first. So the proper way of accessing a library is to include the directory with the headers in the header search path, not to put the headers into your source or copy the contents of them. (Obviously your own code must invoke them with a
<br />
#include <xxxx.h><br />
The linker has it's own, seperate list of libraries to search. You'll need to add the .lib files to your project.
As to getting user actions, if you're doing games you should probably be looking at the DirectInput library. That's what it's there for.
|
|
|
|
|
I am developing a program in eVC and for some reason I am getting these unresolved externals, any ideas? Also, it worked before but suddenly no more.
unresolved external symbol "protected: virtual long (__cdecl** __cdecl CWnd::GetSuperWndProcAddr(void))(void *,unsigned int,unsigned int,long)" (?GetSuperWndProcAddr@CWnd@@MAAPAP6AJPAXIIJ@ZXZ)
unresolved external symbol "public: virtual void __cdecl CFrameWnd::OnUpdateFrameMenu(void *)" (?OnUpdateFrameMenu@CFrameWnd@@UAAXPAX@Z)
unresolved external symbol "public: virtual void * __cdecl CFrameWnd::GetDefaultAccelerator(void)" (?GetDefaultAccelerator@CFrameWnd@@UAAPAXXZ)
unresolved external symbol "public: virtual void __cdecl CFrameWnd::DelayUpdateFrameMenu(void *)" (?DelayUpdateFrameMenu@CFrameWnd@@UAAXPAX@Z)
unresolved external symbol "public: void * __cdecl CFrameWnd::InsertMenuW(unsigned short const *)" (?InsertMenuW@CFrameWnd@@QAAPAXPBG@Z)
unresolved external symbol "public: void * __cdecl CWnd::GetSafeHwnd(void)const " (?GetSafeHwnd@CWnd@@QBAPAXXZ)
unresolved external symbol "public: virtual void * __cdecl CDocument::GetDefaultMenu(void)" (?GetDefaultMenu@CDocument@@UAAPAXXZ)
unresolved external symbol "public: virtual void * __cdecl CDocument::GetDefaultAccelerator(void)" (?GetDefaultAccelerator@CDocument@@UAAPAXXZ)
MIPSDbg/OLEDBCE.exe : fatal error LNK1120: 8 unresolved externals
Error executing link.exe.
Any help is greatly appreciated.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
I think adding MFC42.lib in your lib path would help.
HTH
Jignesh
|
|
|
|
|
MFC42.lib is for the desktop. I am using embeddedVC++ which the lib is called mfcce211.lib which is already being linked. Thanks though.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
I have had the same problem. I resolved the linking errors you are experiening by adding the libraries I needed as dependencies on the current project. This allowed it to access there objects that it needed. The trouble I later ran into was the code wanted a link to a pre-defined term that should be there according to the #include and the library. The funny thing was that it was only an error in debug. Sean
|
|
|
|
|
Sigh. There is always some truth to measure twice and cut once. Upon looking back, I found that I had included the libraries I need in the release copy but not in the Debug. The problem I have run into is that there is no one else in my office that does C++ so if I don't have someone to ask. Glad this forum was here, my program is working now. Sean
|
|
|
|
|
Hello all,
I am a new C++ programmer, and have run into a behavior that I don't understand. Consider the following code:
#include <iostream>
using namespace std;
int aArray[] = {20, 30, 40, 50, 60, 70}; // Create a test array
int myFunc(int *ara); // Func Prototype
void main(void)
{
myFunc(aArray);
return;
}
int myFunc(int *ara)
{
cout << endl << "Address of aArray: " << aArray;
// Returns a memory address.
cout << endl << "Size of aArray: " << (sizeof aArray);
// Returns 24, as expected.
cout << endl << "Address of ara: " << ara;
//Returns same address as aArray, above.
cout << endl << "Size of ara: " << (sizeof ara);
// !! Returns 4. Why is this?
// Does sizeof not work with a pointer passed to a function?
cout << endl;
return 0;
}
In all of the "Beginning C++" manuals I have looked at, the examples show passing the size of the array as an additional parameter to the function. This does address the issue I am dealing with here, but it seems more elegant to be able to interogate the array size **inside** the function. Can someone shed some light on this, please?
Thanks in advance,
|
|
|
|
|
In the first case the compiler knows that you are looking for the size of the array and the data type is int[]. The second time, it is an int* and the size of any pointer is 4 bytes.
--Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
couldn't you do sizeof(*ara)?
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
I am programming using the dialog exe application wizard. I have a dialog box with a scrollbar on it and some edit boxes. The edit boxes have a range of 0 to 100, so if you enter a
number outside that range and kill focus a message comes up and focus goes back to the box.
My OnVScroll function looks like this:
void CWeightDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
m_edit2_ctrl.SetFocus();
int Pos = m_scrollWeights.GetScrollPos();
UpdateData();
switch(nSBCode)
{
case SB_LINEUP:
Pos = Pos - 1;
m_scrollWeights.SetScrollPos(Pos);
break;
case SB_LINEDOWN:
Pos = Pos + 1;
m_scrollWeights.SetScrollPos(Pos);
break;
case SB_THUMBPOSITION:
m_scrollWeights.SetScrollPos(nPos);
break;
case SB_THUMBTRACK:
m_scrollWeights.SetScrollPos(nPos);
break;
}
UpdateText();
UpdateEditBoxes();
CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}
.
If the value in the edit box is outside the range and I click on the scrollbar I get a "Debug Assertion Failed" message (File: wincore.cpp Line: 3102) and the prog bombs.
This occurs during the UpdateData() function. Removing UpdateData(); at the beginning solves the problem but I lose the data
I have tried using SetFocus at the beginning of OnVScroll to force it to check whether it is range but this does not work.
Help!
DAN B
|
|
|
|
|
First up let me admit to my dirty little secret. I am a lazy bastard and use DDX to move data to and from my screen fields and their associated member variables.
I have two ComboBoxes, when I make a selection in the first I want to fill the second with relevant data. Problem is I need to determine what has been selected in the first before I can fill the second.
I have used the following messages CBN_CLOSEUP, CBN_EDITCHANGE, CBN_SELENDOK and CBN_SELCHANGE. With each one, when I enter the function and call UpdateData(TRUE) the ComboBoxes member variable remains empty.
Should I be using another message I have yet to find or should I use some member function of CComboBox to achieve this?
PS. Tomasz how do you always have the relevant Knowledge Base article ready to quote. Have you commited them to memory or do you just have a search before posting your responses?
I have only used the knowledge base articles to fix operating system and network problems in the past. Didn't know there was so many development related answers there.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|