|
Hello there,
I have an application called UDPApp (I am trying to write a UDP server) in MFC. Now in the menu I have an option "File>Listen Port" to decide which port the server will listen to for requests.
What I want is that when the user clicks on the menu option Listen Port, he gets a dialog box called ListenBox. (ListenBox is a member variable of the view class UDPAppView).
So I have the following message handler in the UDPAppView.cpp file
void CUDPAppView::OnFileListenport()
{
if (ListenBox.DoModal() == IDOK) {
//Code....
}
}
According to my expectation, whenever the user clicks the menu option "File>Listen Port", the message handling code in UDPAppView.cpp should get executed and I should see the dialog box.
But the problem is that nothing happens when I click File>Listen Port!!!
Help me someone PLEASE!!
Thanks,
Mike
|
|
|
|
|
Is the code at the top of the .cpp and in the .h file to link this function to this message intact ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Hi there ! I am trying to get a start with the WTL .
I am using it in a DLL if that is important I got all compilation issues resolved I also added an
extern CAppModule _Module;
and the local declaration for it in an implementation file
CAppModule _Module
This way I got all unresolved externals resolved, except one, and I just don't know what I need to link to get it away.. this is the error:
error LNK2001: unresolved external symbol __imp___CrtDbgReport
Anybody knows whats going on here ?
|
|
|
|
|
How can I in code to change the picture that appear in my picture control - load another bitmap(IDB_BMP1) from my resources.
|
|
|
|
|
With ::LoadBitmap() or LoadImage() functions
If you are using the CStatic class After that you can use CStatic::SetBitmap(HBITMAP) where HBITMAP is the Handle that you got in one of the first functions...
Best Regards....
Chau!!!
Carlos Antollini.
|
|
|
|
|
|
Don't mention it...
We are for help us!!!!
Best Regards!!!
Chau!!!
Carlos Antollini.
|
|
|
|
|
Carlos, me parece que lo quisistes decir es, "Estamos aqui para ayudarnos", verdad? Si es asi, entonces se dice: "We're here to help each other".
Chao,
Alvaro
|
|
|
|
|
What was it? Spanish? Brazillian? or Cuban?
Sounds interesting though.
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
Dear Fazul...
It was Spanish, Alvaro was correcting me because my English is not good.
Alvaro: gracias por corregirme, tengo que ponerme al día con mis clases de Ingles.....
Buen Fin de semana.
Good Weekend....
Carlos Antollini.
|
|
|
|
|
Yeah, I could smell that:
corregirme (correction?)
Ingles (English?)
Have a nice weekend.
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
Very Well!!!
You lern quickly!!!
Have a nice weekend....
Carlos Antollini.
|
|
|
|
|
Hi all,
Q1. What is Initial Catalog in connection string ?
Q2. Please explain about CursorLocation ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Dear Hadi I will answer yur questions.
A1. Initial Catalog is the database in wich you connection will do the pointer.
For example if you Use Initial catalog= db1 over SQL Server your connection will open the db1 database....
A2.CursorLocation: This property allows to select between cursor libraries accessible to the provider.
Usually, you can choose between using a client-side cursor library or one that is located on the server.
Best Regards.....
Chau!!!
Carlos Antollini.
|
|
|
|
|
Hi Mr.Carlos, thanks alot for your answers,
Reply A1:
hmmm, so i must write my database name in Initial Catalog, so what i'll should write in Data Source ?
Can i write only Provider and Data Source in the connection string for connecting to SQL Server database ?
Reply A2:
When my database is Access, then i can use of CursorLocation ?
If my database is SQL Server, then can i use CursorLocation ?
New Q:
What is difference between thease Providers:
SQLOLEDB and MSDASQL ???
New Q:
Question is about CursorType:
When my database is Access, i must use adOpenKeysey instead adOpenDynamic ? why ?
If my database is SQL Server, can i use adOpenDynamic ?
I'm get confuse
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Dear Hadi.
let me see...
A to Re:A1: Is true you can write the connection string without the Initial Catalog, but you need to selecting the default database in the ODBC driver configuration.
A to Re:A2: When you use a access databaase you only can use the adUseClient Cursor Location or adUseNone. Obviously, in this case, that you will use the first option...
A to New Q:
I will copy directly from the MSDN the following:
Microsoft OLE DB Provider for SQL Server (SQLOLEDB), which directly maps OLE DB interfaces and methods over SQL Server data sources. Microsoft OLE DB Provider for ODBC (MSDASQL), which maps OLE DB interfaces and methods to ODBC APIs. OLE DB consumers connect to a SQL Server database through an existing SQL Server ODBC driver.
We recommend using SQLOLEDB, supplied with SQL Server, as your OLE DB provider. SQLOLEDB maps OLE DB interfaces and methods over SQL Server data sources without using the ODBC API or the SQL Server ODBC driver as intermediaries.
There are differences between SQLOLEDB and MSDASQL. The two providers support different connection properties, and SQLOLEDB does not support the use of an ODBC DSN connection.
A to new Q2:
The problem is the following. When you use CursorLocation equal to adUseClient the only cursor type for use is adOpenStatic if yiu use another cursor type ado will use open static cursor. When you set adUseServer in your cursor location you can select every cursor type.
Cheers!!!;)
Chau!!!
Carlos Antollini.
|
|
|
|
|
Hi again Mr.Carlos ...
Thanks again for your answer ... your help was useful ...
I got my all answers, only i have theory question about CursorLocation, still:
If i wanna write my program for the Server computer, i must change CursorLocation to adUseServer ?
and
If i wanna write my program for the Client computer, i must change CursorLocation to adUseClient ?
Is it right ?
Is it for all databases ?
With Warm Regards,
Hadi !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
You don't want to answet to me ?
(Please check my last question ...)
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I'm sorry Hadi, I have no pardon....
First. Is true you need to use the cursor location over the server.
The explanation is the following. When you select Client Side, the bookmarks, moves, etc are used in the side of the client, dependes the resources that you have in your pc.
When you select server side, the cursor is used the side of the server. The problem is that some databases have no cursor in the server side like Access, because access is not a server. Is like a PassThrought.
If you are writting a program for SQL Server the best is to use the cursor location in the server side, because in that mode you are using the cursor provided for the server, and the server resources for that operation.
Is Clever Now?;)
Bets Regards.
If you don't understood, notify me, because my English is not as well that I want...
Carlos Antollini.
Today is friday!!! for All!!!
|
|
|
|
|
In resume, you need to know what is better for you database, for example if you are using a Jet Database like Access, dbf, etc the only option is adUseClient.
If you are using Database Server like SQL Server, My Sql, Oracle, SyBase, etc the best is adUseServer, but you have the option of adUseClient, but the best for this case is adUseServer...
Best Regards again.
Carlos Antollini.
Today is Friday!!! for All!!!
|
|
|
|
|
Hi Master.Carlos ...
Now, i understand ...
By the way, your English language is very better than me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Whit the resource editor I've created a DialogBar whit button, combo box, check box...
When I wan't to enable/disable them I use the member variable I've create just for them and call theControlVariable.EnableWindow(TRUE);
and it's work very fine... except for push button who become enable and immediatly after disabled...
why?
thanks
Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
|
|
|
|
|
CDialogBar uses command UI update mechanism for buttons. You should add ON_COMMAND handler in the frame class - this will solve the problem of disabled button and provide a place for code which will be executed when user pushes the button. If you want to conditionally enable/disable the button, add ON_UPDATE_COMMAND_UI as well.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Does anyone know how to get the address that internet explorer is browsing? And how to do this for multiple instances of IE? This is for a little program to monitor Web contents that is viewed on a LAN (to keep an eye on naughty students )
Thanks
Kuniva
|
|
|
|
|
Use the BeforeNavigate2 event from IE and write a Browser Helper Object DLL, this will work with every instance of IE.
Use google.com to search for "BeforeNavigate2" and "BHO", you'll find enough resources
regards
|
|
|
|