|
|
Hi,
My application access to a web service, using Visual C++ 6.0 and the Soap toolkit. Now I want to deploy it... the problem is that I don't know quite sure which things I have to install ( and install the full toolkit or the sdk doesn't seem to be a good idea ).
What should I install ?
MSXML4 ?
Mssoap1.dll ?
Mssmo.dll ?
Thanks in advance, greetings
Braulio
|
|
|
|
|
Hello everyone,
May i know how to change the background color of an edit control upon a button click? I have added the WM_CTLCOLOR handler and i'm not sure on how to continue with the button click (I mean when i clicked a button, the edit control should change in color). I have found some sources which are not easy to understand. Your reply is greatly appreciated. Thanks!
///////////////////////////////////////////////////////////////
HBRUSH CTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(pWnd->GetDlgCtrlID() == (int)IDC_EDIT1) // IDC_EDIT1-edit control
{
pDC->SetTextColor(RGB(0, 255, 0));
pDC->SetBkColor(RGB(0, 0, 0));
return (HBRUSH)(m_bkBrush.GetSafeHandle()); // m_bkBrush-CBrush
}
return hbr;
}
|
|
|
|
|
Hi,
the trick is to return the proper hBrush...
create a brush using your back ground color RGB(0,0,0) and then instead of returning
return (HBRUSH)(m_bkBrush.GetSafeHandle()); // m_bkBrush-CBrush
return the created brush
note: create the brush elsewhere (not in the OnCtlColor method, cause it is called 1000000 of times)
hope this helps ya
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Thanks Yaron for your help. I got it in microsoft visual c++ 6.0. However, when i tried this method of changing color in edit control in microsoft visual c++.NET, i am still unable to change the color in the edit control. Do anyone here knows how to insert a message handler - for instance:WM_CTLCOLOR in microsoft visual c++.NET? C++.NET platform does not have the classwizard, therefore beginners might find it difficult to start up with. Anyway, those who might have trouble with the edit control can refer to the link below:
http://www.codeguru.com/forum/showthread.php?s=&threadid=268470
Thanks for your help and replies! Thanks everyone!
|
|
|
|
|
Hey dudes,
I hope someone out there can make sense of this...
I have plenty of experience with sockets programming,
but I can't seem to figure this out.
I've just added some network code to an open source game,
and everything is working fine except the sockets callback.
I'm reusing old code that works perfectly and the callback
function received events instantly, whereas inside the game
it's lucky to receive it 20 secs late, if at all.
I can slow down the frame-rate to an unplayable 9 fps, then
all the callbacks run, but 4-5 secs late.
Does anyone have any ideas?
Does the CPU usage affect sockets callback?
I'm using Visual C++ on Windows environment, and using
WSAAsyncSelect for my callbacks.
Any help would be greatly appreciated.
SLY.
|
|
|
|
|
|
i don't know many games using directplay!
Don't try it, just do it!
|
|
|
|
|
I am currently using Microsoft Visual C++ 6.0, and having problem with this tool. When I create a new dialog based project, let's say with the name of edits, there will be 3 classes listed in the class view pane, that are:
CAboutDlg, CEditsApp and CEditsDlg. When i add a new handler for a button, either by double clicking the button or through MFC ClassWizard, the classes listed in the class view pane will dissapeared. Sometimes one missing, sometimes two or all. i have to to delete the .ncb and .opt file in the folder where the source code is saved, in order to "get back" all the classes listed previously. Does anyone know what is the problem actually? How to solve it?
Thanks and regards,
Eowyn
|
|
|
|
|
very easy,reinstall vc6.0 or install vc.net.;P
|
|
|
|
|
Hi! I've known this to happen - also in later releases of Visual Studio. Try opening your missing dialog's .h files, modify them (just add a blank space and delete it again), then save. This has made my classes come back in the class view.
Rasmus Therkelsen
rasmus.therkelsen@mail.tele.dk
|
|
|
|
|
eowyn wrote:
i have to to delete the .ncb and .opt file in the folder where the source code is saved
You simply have to do that on a regular basis, thats all.
Its like you want to reboot your windows about once per day - just to be sure.;P
The same company, you know?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Just save the .h file. it works for me
John 3:16
For God so loved the world,
that he gave his only begotten Son ( Jesus Christ ) ,
that whosoever believeth in him should not perish, but have everlasting life.
|
|
|
|
|
Hi, can anyone pls explain 2 me what these public declarations are about? Wat values are being returned and why they are declared in such a way. thanks...
int SetActivePage (int nPage);
int SetActivePage (CMyPropDialog* pPage);
CMyPropDialog *GetPage (int nPage);
CMyPropDialog *GetActivePage (void);
|
|
|
|
|
You aren't serious are you? This is elementary C++ programming. I strongly suggest you find a beginner C++ book and read it.
In the meantime, these are overloaded functions. And the asterix means that the object being passed/returned is a "pointer." (I now feel like Dr. Evil explaining the obvious.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
i need help: when i compile the following program (I have tested in bloodshed devc++, and visual c++ .net):
---------------------------------------------------------------------------
#include <fstream>
#include <iostream>
#include <windows.h>
#include <float.h>
using namespace std;
int main()
{
float fnumber=1.123456789012345678;
double dnumber=1.123456789012345678;
long double ldnumber=1.123456789012345678;
cout << "Float: " << fnumber << endl;
cout << "Double: " << dnumber << endl;
cout << "Long Double: " << ldnumber << endl;
cout << "sizeof(float): " << sizeof(float) << endl;
cout << "sizeof(double): " << sizeof(double) << endl;
cout << "sizeof(long double): " << sizeof(long double) << endl;
system("pause");
return 0;
}
----------------------------------------------------------------------------
, the program outputs fnumber, dnumber and ldnumber (all of them) as 1.2346.
i have no clue why this is happening... i am running this program on a athlon xp 2000+, under windows xp pro sp1...
any help will be aprecciated...
|
|
|
|
|
the preprocessors are iostream, float.h, windows.h (i forgot about html tags on the forum...)
|
|
|
|
|
The default precision is the same for all floating-point types. Use the setprecision() manipulator or cout::precision() function to change the number of displayed digits.
|
|
|
|
|
You need to tell cout that you want to see more digits than the default (six I think) is:
[...]
long double ldnumber=1.123456789012345678;
cout.precision(20);
cout << "Float: " << fnumber << endl;
[...].
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Hello, I was wondering if a macro within a .dsm macro file (for use in VC++6.0)can call a function that resides in another .dsm file? If so, what would the code be? Thanks.
|
|
|
|
|
Hi,
I posted about this a few days ago, but didn't get anywhere with it. I have a MFC DLL that I wrote to access a database that I'm using with my program (also MFC).
What I've been doing is in each function I have in the dll, I connect to the database, perform the operation I want and then disconnect. This worked perfectly fine. However, I decided it was a waste of processing time to connect and disconnect each time I accessed the database, so I wrote two functions called connect and disconnect in order to be able to hold onto the database connection for the life of the program.
This is how I did it.
CDatabase database;
__declspec(dllexport) void Connect()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
database.Open( "EmployeeManager" );
}
__declspec(dllexport) void Disconnect()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
database.Close();
}
This seems to me that it would work without problems. However, when I try to close the program it causes an error that says "A Breakpoint has been reached" and it crashes.
All I did was override OnClose and call disconnect before I close. I stepped through the debugger and it doesn't crash on disconnect, but right after the close is executed. There are no breakpoints anywhere in the program so I have no idea what's going on here. Can anyone help me out?
Thanks,
Mike
|
|
|
|
|
Mike Danberg wrote:
__declspec(dllexport) void Disconnect()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
CDatabase database;
database.Close();
}
Here you are closing an unopened database, as CDatabase is local to the function. This makes no sense what so ever. If you are trying to close the database opened in Connect, then you will have to make database a global variable rather than being local to the two functions.
Michael
'Logic, my dear Zoe, merely enables one to be wrong with authority.' - The Doctor: The Wheel in Space
|
|
|
|
|
Oops. I posted the wrong code. Sorry. That CDatabase database shouldn't be in there. I don't remember why I put it there, probably just so it would compile without a problem.
Anyway the code I had, uses a global variable, and it was crashing on close. Looked like this.
CDatabase database;
__declspec(dllexport) void Connect()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
database.Open( "EmployeeManager" );
}
__declspec(dllexport) void Disconnect()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
database.Close();
}
Mike
|
|
|
|
|
I have some C code here, my teachers, that I'm trying to rifle through and figure out. I am confused on on line of it: The second line down is
*b = (int*) malloc ( n * sizeof(int));
does this mean a integer pointer that point to a memory location that is 4 times the size of an integer? Which would be then 16 bytes. So a int pointer that points to 16 bytes of vacant memory. Am I right, close or way off.
Please help. the code below is what it is out of.
Thanks for your help.
#include "stdio.h"
void ByteSwap4_c(int n, int *a);
void ByteSwap4_asm(int n, int *a);
void ByteSwap4(int n, int *a)
{
int i;
int *b = (int*) malloc ( n * sizeof(int));
for (i=0; i<n; ++i)
b[i]=a[i];
ByteSwap4_asm(n,a);
ByteSwap4_c(n,b);
for (i=0; i<n; ++i)
{
if (a[i] != b[i])
{
printf("a[%d] (0x%08X) != b[%d] (0x%08X)\n",i,a[i],i,b[i]);
exit(1);
}
}
free(b);
}
void test4(int n, int *a, int *b)
{
int i;
ByteSwap4(n,a);
for (i=0; i<n; ++i) {
if (a[i] != b[i]) {
printf("a[%d] (0x%08X) != b[%d] (0x%08X)\n",i,a[i],i,b[i]);
exit(1);
}
}
}
int main()
{
static int a[4]={0x01020304, 0xa0b0c0d0, 0xabdcef12, 0x12345678};
static int b[4]={0x04030201, 0xd0c0b0a0, 0x12efdcab, 0x78563412};
test4(4,a,b);
printf("all tests pass\n");
}
void ByteSwap4_c(int n, int *a)
{
int i;
for (i=0; i<n; ++i)
{
int tmp=a[i];
int pmt;
((char*)(&pmt))[3]=((char*)(&tmp))[0];
((char*)(&pmt))[2]=((char*)(&tmp))[1];
((char*)(&pmt))[1]=((char*)(&tmp))[2];
((char*)(&pmt))[0]=((char*)(&tmp))[3];
a[i]=pmt;
}
}
|
|
|
|
|
The malloc() call allocates space for a table of n integers.
|
|
|
|
|