|
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
|
|
|
|
|
|
/*************************************
* This should be put at the top of *
* the .cpp file in which you want *
* the sound functions to be used *
*************************************/
#INCLUDE <mmsystem.h>
/**************************************/
/**************************************
* Go to project/settings/links *
* and add winmm.lib to the listing *
**************************************/
/**************************************************
* Place the below code wherever you would like *
* inside the .cpp file that you included the *
* header file that i mentioned earlier *
**************************************************/
PlaySound((LPCSTR) IDR_WAVE1, NULL, SND_ASYNC | SND_RESOURCE | SND_LOOP);
// The above will play IDR_WAVE1 as a resource in sync and will loop
/***************************************************************************
Now go to the resources tab and right click for simplicity the dialog folder and hit import. change the file type to wave and then find the wave that you want to make a resource. Once that is done make sure it is named IDR_WAVE1. and that should do it you should now have sound.
****************************************************************************/
/***************************************************************************
You might want to add a bool check box to turn the sound on and off cause it might sound cool but after a while it gets annoying at least in my program it did.
****************************************************************************/
//Example of how to turn sound on or off
//make a check box named sound
// give it a control variable call it m_soundcontrol;
// In the onInit of the dialog put m_soundcontrol=true; to turn sound on
// also add
// PlaySound((LPCSTR) IDR_WAVE3, NULL, SND_ASYNC | SND_RESOURCE | SND_LOOP);
// this will turn the sound on at the get go
// then double click on the check box you made and it will make
// a function called Onsound()
// add some code to turn the sound on and off
void CStartingOverDlg::Onsound()
{
if (!m_soundcontrol)
{
m_soundcontrol=true;
PlaySound((LPCSTR) IDR_WAVE3, NULL, SND_ASYNC | SND_RESOURCE | SND_LOOP);
}// end of if
else
{
m_soundcontrol=false;
PlaySound(NULL,NULL,SND_ASYNC|SND_LOOP); // sends a null sound to turn off
} //end of else
} // end of function
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
Hi guys
WHats the way to manage the keyboard inputs in a CFormVIew.
Theres is a way to catch all them and control what to do?
What's the right message to manage it?
I've tried with OnChar and OnKeyDown, but it doesn't work?
Best Regards
Doc
|
|
|
|
|
Hello everyone, i am trying to display a given time in my mfc program.
I simply do not know how to display the current time when a user clicks a certain button. I have this in my code
CString s_time;
time_t start;
time (&start);
s_time = start;
MessageBox(s_time,"");
This does not seem to work, how can i take what is in start and convert it into a CString and display it.
If anyone could help it would be great.
none
|
|
|
|
|
Hi, you can use MFC CTime class;
CTime time = CTime::GetCurrentTime ();
MessateBox (time.Format ("Time is %H:%M:%S"));
|
|
|
|
|
I am trying to place a common print dialog, with my own dialog template, as a child in a tab control, and I cannot seem to get it working. I have managed to get the Main Dialog to create the common controls and then move them to the Child Dialog, but they no longer respond to user interaction. I see that the message routing need to be played with. Is there a easier way, examples etc... Thanks All
|
|
|
|
|
How I can set the colour on button. Like set the blue colour on button skin.
|
|
|
|