|
GetDlgItem(IDC_WHATEVER)->SetWindowText("blah blah");
etc etc
"there is no spoon" biz stuff about me
|
|
|
|
|
I have a file that is included in a .cpp file and I keep getting this error:
error LNK2001: unresolved external symbol "public: void __thiscall CDBFRecordset::Open(char const *,unsigned int)" (?Open@CDBFRecordset@@QAEXPBDI@Z)
the file is right in the same project directory. anyone know what's going on?
If it's broken, I probably did it
bdiamond
|
|
|
|
|
You may have to change a parameter in the stdafx.h file. Either change from EXTRA_LEAN to LEAN or #include "dao.h" if memory serves.
|
|
|
|
|
In the stdafx.h file in ur current project, include the file <afxdb.h>. Just check the CRecordSet class page in MSDN.
|
|
|
|
|
Hello,
I have an application that uses a lot of controls in a CFormView window. Everything works fine in winXP or win2K, but the program crashes in win98
saying "unsupported operation performed" and the there is crash in MFC42.dll
I can make the program not crash by commenting out few controls in the .rc file.
CONTROL "Scale",IDC_Pref1,"Button",BS_OWNERDRAW,130,18,10,10
CONTROL "Scale",IDC_Pref2,"Button",BS_OWNERDRAW,130,41,10,10
If I comment either of the above lines in the .rc file everything works. It seems like there is a maximum number of controls one can have in a CFormView. Is that true if so is there a workaround?.
Thanks
ashish
Ashish More
|
|
|
|
|
Consider using custom property pages. What I mean by this is that you should group the relevant controls together, then move each of these groups into a seperate dialog. Then, inside your CMainFrame, create a CTabCtrl and load each of the dialogs in a successive page order. When one page is shown, all other dialogs (pages) are destroyed and cleaned up. When user clicks on a tab, create a modeless dialog and display it.
This increases the execution time a bit, but should not pose a problem on modern systems. I somehow have a picture that if a dialog box has more than 255 controls, it causes this type of behaviour on Windows 98 and earlier. I am not sure though.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Good suggestion.
Unfortunately I need all the controls to be visible.
Is there any way to group multiple button controls into one "image map button" so that I only have one "Uber button" instead of 4 or 5 individual buttons.
|
|
|
|
|
The "SCALE" oxc (I'm presuming you're using one) needs to be present and registered on your Win98 system.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
the Scale is a control of the class CHoverbutton. and it works in win98 if I reduce the number of controls in the dialog
|
|
|
|
|
Hi all..I have been developing applications in Visual Basic 6 for quite some time now. I want to do the same in VC++.
-Is there any drag/drop capability for placement of controls in VC like in VB?
-Someone told me that resource editor in VC has got that sort of a capability. How can i build GUI using the same and then write events for the controls?
|
|
|
|
|
Select a project type as Dialog application, then you can do most of the things like VB but its not the same, and if you screw up with wrong Message handler, you will screw up the whole project.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
You can't do this as easily as you can in VB. But, if you're using VC6 then the Resource editor plus ClassWizard are the tools you need. There should be tutorials elsewhere on this site. Probably the easiest way to get started is to create an MFC Dialog-based application and program a few buttons and text boxes.
You might also want to look at the RadVC add-on tool, which gives VB-like capability to VC++. http://www.capitolsoft.com/[^]
Kevin
|
|
|
|
|
I solved the previous problem ( I forgot a semicolon after a function prototype). Now I keep getting a 'enum' type redefinition error and the include file has all the include guards, and I've also used this header file before. Any suggestions?
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Make a global search for the enum that you are defining may be it is redefined somewhere else.
put
#pragma once as the first line in the header file to prevent recompilation.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
I'm trying to compile a dll that is statically linked to MFC. I keep getting this error message:
error C2143: syntax error : missing ';' before '<class-head>'
the file that it's saying this about I've used before but it's blowing up at this spot now:
typedef struct
{
DBF_UCHAR dbf_id;
DBF_CHAR last_update[3];
DBF_LONG last_rec;
DBF_UINT data_offset;
DBF_UINT rec_size;
DBF_CHAR filler[16];
DBF_CHAR table_flag;
DBF_UCHAR code_page;
DBF_UINT reserved;
} DBF_HEAD;
I've got all the include directories for the libraries and header files included in the project, can anyone help?
---If it's broken, I probably did it
bdiamond
|
|
|
|
|
I'm also getting this error message for the same file:
fatal error C1004: unexpected end of file found
If it's broken, I probably did it
bdiamond
|
|
|
|
|
bdiamond wrote:
fatal error C1004: unexpected end of file found
for this problem,
go to project settings->C/C++ tab-> category(Precompiled Header) select not using precompiled header.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
If I have a pointer to an array allocated with malloc , I can use _msize to find the size of the allocated memory. However, if I use new[] to allocate the memory, _msize fails miserably.
How can I find the length of a memory block allocated with new[] ? Something like
class C
{
string s;
char* g;
int b[45];
};
...
C* multinew = new C[10];
...
unsigned multinewsize = _msize(multinew);
|
|
|
|
|
You could do:
C* multinew = (C*)malloc(sizeof(C) * 10);
for(int i = 0; i < 10; ++i)
new (multinew + i)C;
That should make it possible to use _msize at least. Although, that's a bit farfetched.
Otherwise, how about using std::vector instead?
--
Ich bin der böse Mann von Schweden.
|
|
|
|
|
I was looking for a way to make a functor that would delete pointers to both single objects and arrays. It should somehow recognize whether a pointer points to an array or not, and apply delete or delete[] (or even free() if it was allocated with malloc ). I just can't find out what a pointer is pointing to. I know there is no portable way to do this, but I hoped that maybe there is some Windows-specific trick.
|
|
|
|
|
I guess you could define your own new, new[]. So when you allocate a memory block, you allocate memsize + 4 bytes (for alignment's sake). Write some magic constant in 31 of the 32 bits, and use one bit to indicate whether the allocated memory was new'ed or new[]'ed. Kind of like this:
+--------------+----------------...----------+
| M A G I C F | M e m o r y c h u n k |
+--------------+----------------...----------+ Your version of new and new[] returns a pointer pointing to the "memory chunk". It's sort of similar to how BSTRs work I guess.
--
Ich bin der böse Mann von Schweden.
|
|
|
|
|
Hi!
I have to encrypt a string of text. My text is a CString . The function I call is this:
encrypt(const unsigned char* in, unsigned char* out, size_t n)
I have this:
CString strOutput, strInput = "hello world";
int len = strInput.GetLength();
unsigned char *buf = new unsigned char[len];
memset(buf, 0, len);
strcpy(buf, strInput);
encrypt(buf, buf, len);
strOutput = buf;
delete [] buf;
Can anyone tell me how to convert from a CString to a unsigned char *?
|
|
|
|
|
try this:
sprintf(buf,"%s",strInput);
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Hello!
or try this:
strcpy(buf, (LPCTSTR)strInput);
|
|
|
|
|
Hi, i have been trying to play a wav sound within my app but it will only let me play a default windows sound. I have tried various ways. Does any one know how? or does any one know of a detailed web site telling me how to play wav? Does it need to be saved as a resource? if so how.
Thanks
|
|
|
|