|
The MFC and CRT source code have never heard of it either.
What the heck is a CTabStrip?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It is the control containing just the tabs.
(Microsoft Forms 2.0 TabStrip.lnk in Registsered Active X controls in gallery _ VC6.0) )
I am hacking " visual framework "
( http://www.codeproject.com/dialog/visualfx.asp)
and I need to add a spinner control to move the tabs into focus when there are too many tabs in the tab client area.
I am having great time hacking this code and need to speed thigs up a little.
What I was going to do is make invisible tab control to gain acces to the spinner. But it is getting to complicated.
Vaclav
|
|
|
|
|
OK. With your help I managed to finish my project. One last thing to do.
How to build an exe file from my mfc project so it can run on any windows base computer?
|
|
|
|
|
|
|
Oh yeah, good One Bookmarked.
Thanks,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
In my app, i need large float data, so i create a class for it.
but existing functions, such as sin(.), log(.) ..., are all use double, so I have to create similar functions to suit my large float numbers.
How to create my own sin(.), log(.) etc?
|
|
|
|
|
includeh10 wrote: so I have to create similar functions to suit my large float numbers.
http://www.netlib.org/cephes/[^] already exists.
But if you really want to write your own, pull the sources for GNU compilers standard math libraries, and extend them to long double.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
|
Hi people,
I m facing a problem with sockets.
My application connects to a device that has an IP and a port. If i switch on the device first and then my application i m able to establish consistent communication between them; however if i run the application first and then turn on the device it doesnt connect then.
P.S: I m using a Connect-button on the front-end to connect
Please help.
Button Connect function is as follows:
m_sConnectSocket1.Create();
m_sConnectSocket1.Connect(m_strIP1,m_iPort1);
|
|
|
|
|
You should check error codes...
m_sConnectSocket1.Create();
if (!m_sConnectSocket1.Connect(m_strIP1,m_iPort1))
{
int sockerrcode = m_sConnectSocket1.GetLastError();
if (sockerrcode == WSAEWOULDBLOCK)
{
}
else
{
}
}
...
void MySocketClass::OnConnect(int nErrorCode)
{
if (nErrorCode != 0)
{
return;
}
...
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I get error code 10035-WSAEWOULDBLOCK, that is when it connects but if i run the apllication first and then the device i get errorcode 10022 WSAEINVAL
If OnConnect() event is triggered shouldnt the error code be 10056?? Or, conversely, what error code(s) are/is possible if OnConnect() gets triggered??
By your code it seems a successful connection would produce an err-code of WOULDBLOCK.
Actually what i m doing in my new code is i keep trying to connect till the error code is 10056 or a timeout of 2 seconds, whichever is first. This i guess could be a wrong procedure. But it always works if i start the device first.
|
|
|
|
|
The possible error codes for Connect() are listed in the documentation for
CAsyncSocket::Connect() and also can be found in the Winsock docs:
connect() (Windows Sockets 2)[^]
Any time you use asynchronous sockets, an error of WSAEWOULDBLOCK
means the operation has NOT completed yet so no error info is available
at that time. To find out if the operation succeeded or not, you need
to get the results in whatever asynchronous completion method you're using.
In your case, that's in an overridden OnConnect() method.
yashveer wrote: Actually what i m doing in my new code is i keep trying to connect till the error code is 10056
That's not a proper way to check for a successful connection. Either there's an error or there's not.
You can find that out using the example code (or similar) that I posted previously.
And please use "WSAEISCONN" instead of "10056" when posting error codes.
I don't have them all memorized so I have to look them up. They'll make your code more
readable as well
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have a problem. I am trying to catch some exception and I still haven't succeded. I tried with very simple example but still isn't working. Cakb someon help. Here is the code;
try
{
int a=5, b=0, c;
c = a/b;
}
catch (CException* e)
{
MessageBox("Division by zero exception!");
}
My program ends with error without executing the code in catch block.?????
|
|
|
|
|
try
{
int a=5, b=0, c;
c = a/b;
}
catch (...)
{
MessageBox("Division by zero exception!");
}
|
|
|
|
|
You can use of this code
try
{
int a=5, b=0, c;
if (b == 0)
throw int();
c = a/b;
}
catch (int)
{
MessageBox(_T("Division by zero exception!"));
}
|
|
|
|
|
See this[^] article on MSDN about exceptions. The first example illustrates handling divide-by-zero handling.
Software Zen: delete this;
|
|
|
|
|
Can I be able to convert VC++ builtin header files to DLL file.
As an experiment i tried in math.h but failed to create a dll.As build log said unable to register dll and dll was present no where.
And also how can i export my constants.Is that also possible?
Am I lacking a perfect picture of the whole thing DLL is doing?Help me please
|
|
|
|
|
You can't 'convert' header files into DLL's. A header file describes the contents of a DLL. A given header file may describe only part of a DLL. For example, math.h describes math-related functions in the C runtime library. The actual DLL in this case is MSVCRT.dll, which is usually installed in C:\Windows\System32.
You shouldn't need to do anything to create this DLL; it's installed as part of Windows, since so many Windows-supplied applications and components use it.
If you have general questions on creating and using DLL's, this[^] is an entire section of Code Project devoted to the subject.
Software Zen: delete this;
|
|
|
|
|
Can Anybody Tell me How to use picture Control.
I need to dynamically load the image on that picture Control.
Using Win32 Application
|
|
|
|
|
Can you more explain about picture control? for load images see OleLoadPicture and if your images are bmp you can use of LoadImage of course if your program was MFC you could use of CImage class if you want to assign a image to a control you can use of CStatic control on the toolbox when you insert this control to your program it has a function SetBitmap(with hbitmap handle) that you can show your image.
|
|
|
|
|
A picture control is a static control with the SS_BITMAP, SS_ICON, or
SS_ENHMETAFILE style.
To set the control's image you can use the STM_SETIMAGE message
(I'll assume you're using the SS_BITMAP style):
HBITMAP hNewBitmap = ...;
HBITMAP hPreviousBitmap = ::SendMessage(hwndPicConrol, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hNewBitmap); Where is the image coming from that you want to set to the control?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thnk you for reply. But how do i get the handle to picture control. i.e hwndPictureControl
|
|
|
|
|
If you created the control with CreateWindow[Ex]() then the API will return the handle.
If the control is on a dialog created from a dialog resource, the you can use GetDlgItem()
to get a handle to a dialog control given its ID.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hi all
I want load GIF file in the touro c++ but I don't know how I can
do its
plz hellp me
thanks alot
bye
|
|
|
|