|
The first thing you need to do is make your app single instance. Then when it starts up and the other instance already exists, pass this command line over to it so it can load the file.
I have done this with a variant of one of the single instance[^] classes here on CP. If you get this working on your app, I can send you the info about the extra mods to allow you to open files passed in on the command line.
Roger Allen
Sonork 100.10016
In case you're worried about what's going to become of the younger generation, it's going to grow up and start worrying about the younger generation. - Roger Allen, but not me!
|
|
|
|
|
I was thinking single instance with subsequent instances sending messages to the first. Your link to PJ's article will be a big help with this. Thanks a lot.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
Roger, I just thought I'd pass along, that with some more experimenting and research, I've discovered that a straight out of the box, App-Wizard generated MDI app, where you specify the file extension for the document, will behave exactly the way I described. So now I'm just going through all the changes that have been applied to my existing app to locate code that's been removed and thus causing this needed behaviour to go away. It looks to be mostly related to ensuring a wack of registry entries are setup so as to obtain this behaviour.
Thanks again.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
|
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.
|
|
|
|
|