|
hi,
I'm new in C++ and i really don't know how to change the font size and font face of a static text control. In Visual Basic it's quite simple
Hope anybody can help me,
ckr
|
|
|
|
|
If using MFC, it is as easy as the CWnd::SetFont(...) function.
Peace!
-=- James (Sonork:100.21837)
[Tip for SUV winter driving survival: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"!] [Get Check Favorites 1.5 Now!]
|
|
|
|
|
Hi,
I have an ATL COM DLL, with a method which needs to be used to pass a string in & out from VB. In the interface it's declared as [in,out] BSTR*. Yet the string which is passed back to VB always appears empty.
If I change things slightly to [out,retval] BSTR*. The method is seen to VB as a function and the string returns fine.
Anyone any clues? or examples, tried all sorts.
Cheers
Rich
|
|
|
|
|
I thought if it's an in out parameter you need to pass a string into the function, not expect it as a return value. Works for me in VBScript, but I dunno about VB. I expect it's the same.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hello,
First off im no guru on this.. I am trying to learn how to use network event objects...
I followed an article here on Codeproject and have been researching this on Google and MSDN but I can't figure it out.. I guess I have a few questions.. 1st.. Does the third value in WSAWaitForMultipleEvents sleep the thread when its set to TRUE?? If its supposed to then something is wrong with my code because it doesn't sleep..
2nd.. Does this code look right? Am I missing something? I put a break point on the if((wsaCloseEvent.lNetworkEvents & FD_CLOSE)) and it goes right past.. doesn't seem like the thread is waiting for the event to happen.. It just goes right past..
3rd.. any suggestions on where i can get more info on Network event objects and some samples?
Thanks!!
Rob
WSAEVENT hEvent = WSACreateEvent();
WSAEventSelect(s,hEvent,FD_CLOSE);
int nErrorSelect = WSAGetLastError();
if(nErrorSelect != 0)
{
}
else
{
WSANETWORKEVENTS wsaCloseEvent;
WSAEnumNetworkEvents(s, hEvent, &wsaCloseEvent);
WSAEVENT* pEvents = (WSAEVENT*)::calloc(1, sizeof(WSAEVENT));
pEvents[0] = hEvent;
WSAWaitForMultipleEvents(1, pEvents,
TRUE, INFINITE, FALSE);
if((wsaCloseEvent.lNetworkEvents & FD_CLOSE))
{
WSACloseEvent(hEvent);
closesocket(s);
PostThreadMessage(UWM_CLOSE_SOCKET,0,0);
}
|
|
|
|
|
Hello...
Does anybody know how to get information about that?
I need to know if the taskbar is visible (or without the autohiding property selected) and it's height.
Thank you very much...
NOTE:
it would be great for me knowing how to set that property programatically...
|
|
|
|
|
try this:
APPBARDATA abd;
UINT fuState;
fuState = (UINT) SHAppBarMessage(ABM_GETSTATE, &abd);
fuState will be zero if the taskbar is not in the autohide or always-on-top state. Otherwise, it will be one or both of the following:
ABS_ALWAYSONTOP
ABS_AUTOHIDE
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Can somebody please tell me what is wrong with my source code here because I started writing a program like I always do. Basically this is my template. When I compile it and run it, the class registrationg goes fine. But when I try to create a window I get an error saying that "Cannot create a file when it already exists". I don't get it. Why would it say that? I don't see anything wrong with my code either. I have used the same source code several times before.
#include <windows.h>
const char szMyClsName[] = "MyWndClass";
LRESULT CALLBACK WndProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
ATOM RegisterMyClass( HINSTANCE hInst);
BOOL InitWindow( HINSTANCE hInst, int nShowCmd);
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
MSG msg;
if( !RegisterMyClass( hInstance ) )
{
MessageBox( NULL, "Error 1", "Error", MB_OK );
return FALSE;
}
if( !InitWindow( hInstance, nShowCmd ) )
{
MessageBox( NULL, "Error 2", "Error", MB_OK );
return FALSE;
}
while( GetMessage( &msg, NULL, 0, 0 ) > 0 )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
return msg.wParam;
} // end WinMain
ATOM RegisterMyClass( HINSTANCE hInst )
{
WNDCLASSEX wc;
wc.cbSize = sizeof( wc );
wc.style = CS_VREDRAW | CS_HREDRAW;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInst;
wc.hIcon = LoadIcon( NULL, IDI_APPLICATION );
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszMenuName = NULL;
wc.lpszClassName = szMyClsName;
wc.hIconSm = LoadIcon( NULL, IDI_APPLICATION );
return( RegisterClassEx( &wc ) );
}
BOOL InitWindow( HINSTANCE hInst, int nShowCmd )
{
HWND hWnd;
hWnd = CreateWindowEx( WS_EX_CLIENTEDGE, szMyClsName,
"Test",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInst,
NULL );
if( !hWnd )
return FALSE;
ShowWindow( hWnd, nShowCmd );
UpdateWindow( hWnd );
return TRUE;
}
LRESULT CALLBACK WndProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam )
{
switch( Msg )
{
case WM_CLOSE:
DestroyWindow( hWnd );
break;
case WM_DESTROY:
PostQuitMessage( 0 );
break;
default:
DefWindowProc( hWnd, Msg, wParam, lParam );
break;
}
return 0;
}
none
|
|
|
|
|
The default message at WndProc is
DefWindowProc( hWnd, ... );
break;
when it should be
return DefWindowProc( hWnd, ... );
Sorry guys it took me a few days to realize that this is wrong.
none
|
|
|
|
|
Tengo un programa en Visual C++ con su correspondiente codigo fuente que captura y envia datos por el puerto serie. Mi problema es que los datos que recibo bienen codificados. Estos datos son procedentes de una máquina conectada a mi ordenador por el puerto serie. Si en vez de ejecutar en mi ordenador mi aplicacion, ejecuto el hyperterminal de windows y le digo que se conecte a la máquina por el puerto serie y que emule un terminal VT100 recibo los datos perfectamente descodificados y colocados en pantalla. Que podría hacer para que mi aplicación en Visual C++ 6.0 con MFC consiga recibir los datos como el hyperterminal. Cualquier posible respuesta me serviría de mucha ayuda. Es para mi proyecto de fin de carrera que quiero acabar cuanto antes.
Muchas gracias por adelantado.
This is a traduction in english that someone have done for me:
I've got Visual C++ program with source code for implementing data
sending and receiving through the serial port. Problem is that received
data come encoded. These data come from a machine connected to my
computer via the serial port. If instead of executing my app I run
Windows Hyperterminal instructing it to emulate VT100 data are
received OK and displayed properly on the screen. What could I do
in order for my MFC based app to treat data the way Hyperterminal does.
Any answer would be most helpful. This is for my graduate project, which
I'd like to have completed as soon as possible. Many thanks in advance.
Thank you for your interest for trying to translate it. If you have a solution for my problem plese tell it to me in english.
Ayuda para mi proyecto fin de carrera!!!!!!!!!!!!!
Help about my final course proyect
Ayuda para mi proyecto fin de carrera!!!!!!!!!!!!!
Help about my final course proyect
|
|
|
|
|
I'm sorry, I don't speak Spanish to help you, But I'm having a blast just trying figure out what you want to do/what is the problem ...
As far as I can read :
You have a program that sends data to the serial port, but there's a problem, the data is either coded or encrypted ( bummer ! ). But in particular you have someone using the hyperterminal with a VT100 emulation and that the data is decoded perfectly! and you're wondering why your application is not working like hyperterminal.
Am I close ?
Max.
|
|
|
|
|
Quick translation:
I've got Visual C++ program with source code for implementing data
sending and receiving through the serial port. Problem is that received
data come encoded. These data come from a machine connected to my
computer via the serial port. If instead of executing my app I run
Windows Hyperterminal instructing it to emulate VT100 data are
received OK and displayed properly on the screen. What could I do
in order for my MFC based app to treat data the way Hyperterminal does.
Any answer would be most helpful. This is for my graduate project, which
I'd like to have completed as soon as possible. Many thanks in advance.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Could it be that the received data contains ANSI escape sequences which, while handled correctly by the terminal, may show up looking like garbage data when viewed directly?
In that case, look up VT100 ANSI escape sequences.
Peace!
-=- James (Sonork:100.21837)
[Tip for SUV winter driving survival: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"!] [Get Check Favorites 1.5 Now!]
|
|
|
|
|
This is a traduction in english that someone have done for me:
I've got Visual C++ program with source code for implementing data
sending and receiving through the serial port. Problem is that received
data come encoded. These data come from a machine connected to my
computer via the serial port. If instead of executing my app I run
Windows Hyperterminal instructing it to emulate VT100 data are
received OK and displayed properly on the screen. What could I do
in order for my MFC based app to treat data the way Hyperterminal does.
Any answer would be most helpful. This is for my graduate project, which
I'd like to have completed as soon as possible. Many thanks in advance.
Thank you for your interest for trying to translate it. If you have a solution for my problem plese tell it to me in english.
Ayuda para mi proyecto fin de carrera!!!!!!!!!!!!!
Help about my final course proyect
|
|
|
|
|
I'm sorry, I can't give you help, but have you looked at the VT100 specification ?
vt100(vt220) specs[^]
maybe this can help !
Max.
|
|
|
|
|
I want to manually create a wave file in VC++
and i also want to transfer data between these files
kindly give me some algorithms relating to that.
i am waiting ...........
Hamza.
|
|
|
|
|
I have a 3rd party activeX control that I am using in a FormView. I want to expose this object to the VBA IDE (which I have hooked into the application). Has anyone been able to do this or could give me an idea of how to get it done?
Thanks
Zac
"If I create everything new, why would I want to delete anything?"
|
|
|
|
|
I would like to access the data to SQL server on a remote machine. Are there any issues when connecting via an IP address vs. writing my own server and marshalling the queries through it. I would prefer to connect directly so I have all the power of recordsets locally in my application.
Some of the issues I would like to know about are:
1) Security - Does the data come in a raw format with the schema and everything?
2) Performance - What kind of overhead does the transfer make?
3) Usability - Is it really as easy as connecting to SQL server on a local machine?
4) Anything else I should know
Cheers,
Clint
|
|
|
|
|
1) Security - Does the data come in a raw format with the schema and everything?
I never looked at it using a sniffer, so I do not know for sure, but I would quess that the only schema-specific information passed across is what you asked for. For example, if you did a query for SELECT ColA, ColB FROM SomeTable , I would not expect to have information about the entire schema passed across the wire, just information on the two requested columns (type, length, precision, etc).
2) Performance - What kind of overhead does the transfer make?
The only time I notice a real difference is speed is when my connection to the remote server is going slower than normal. For example, if you are located on the same network as the server, with little traffic on the wire, your performance is going to be pretty good. I would wager that the overhead is less than you would have using DCOM...
3) Usability - Is it really as easy as connecting to SQL server on a local machine?
It always has been for me. You should be able to connect to a remove machine name or even an IP Address just as easily as typing in the name of your local machine.
4) Anything else I should know
Many other database-based applications are done in two or more separate physical tiers, so what you are trying to do is pretty "normal".
Peace!
-=- James (Sonork:100.21837)
[Tip for SUV winter driving survival: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"!] [Get Check Favorites 1.5 Now!]
|
|
|
|
|
Hi!
I need to reinstall my windows in a few weeks, and thus remove all programs. But I want to save my Visual Studio preferences (such as colors, include/lib-paths etc.) and restore them upon reinstall. Where can I find them?
thanks in advance
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Check the settings under this registry key.
HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0
Hope this helps.
// Fazlul
|
|
|
|
|
Great, this seem to be all settings. Thanks a lot!
modified 12-Sep-18 21:01pm.
|
|
|
|
|
In windows registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\.
Pavel
Sonork 100.15206
|
|
|
|
|
Hello...
ENVIRONMENT:
Windows 2k sp3
INTRODUCTION:
I've been for two days making a derived class that intends to automate the resizing of a property sheet.
I'm trying to be able to create a property sheet and only passing a CRect to one of its functions get all that property sheet, its tabcontrol and so on resized properly...
I've noticed that the MoveWindow and SetWindowPos behaviour changes depending on the visibility of the taskbar.
At least when I try to move a button to the bottom part of the screen it gets positioned different depending on the visibility of the taskbar.
QUESTION:
Could somebody explain why this happens, tell me any way to avoid it or to manage the resizings taking care of that?
I would like to be able to resize as I would like to do not depending on the taskbar state.
NOTE:
I've been using this code:
<br />
this->m_rectPS.left = 0;<br />
this->m_rectPS.right = ::GetSystemMetrics(SM_CXSCREEN); this->m_rectPS.top = 0;<br />
this->m_rectPS.bottom = ::GetSystemMetrics(SM_CYSCREEN);
<br />
<br />
ResizePS(this->m_rectPS);
<br />
the property sheet is being resized properly, but it's buttons not, and they are what seems to depend on the taskbar... (using movewindow)
As always thank you in advance...
|
|
|
|
|