|
Connect to the database, read the strings from it and then use CComboBox::AddString to add the strings in the combo box.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I think you need to MFC and MySQL[^] (MFC classes to fill ComoBoxes & ListBoxes with MySQL data.)
|
|
|
|
|
call AddString() function to add data.
nave
|
|
|
|
|
Do you have problem with create ComboBox or Read table?
|
|
|
|
|
Its Become hard for me to showing data in Combobox
Regard's
Kaushik
|
|
|
|
|
Did you see my last post I think it was your answer.
|
|
|
|
|
Yes i come to Know .
My problem is solved now
Thanks for this
Regard's
Kaushik
|
|
|
|
|
|
Hi,
I am using Visual studio 2005 for my application.
In my application,Loadlibrary is used,
LoadLibrary("library.dll");
If i simply give like this, it's showing error as "cannot convert parameter 1 from const char to LPCWSTR",so i typecasted it as,
LoadLibrary(_T("library.dll"))
or
LoadLibrary((LPCWSTR)"library.dll"))
if i give like this it is not taking or recognizing the library gives error as No such lib found.
Please I need help...
Siddharth
|
|
|
|
|
siddharthsan wrote: "cannot convert parameter 1 from const char to LPCWSTR",
This is because in your project setting the _UNICODE is defined. So you must specify unicode string like LoadLibrary(_T("library.dll")) or LoadLibrary(L"library.dll").
siddharthsan wrote: LoadLibrary((LPCWSTR)"library.dll"))
This is not the corrcect way. This casting dosent make the string unicode.
siddharthsan wrote: library gives error as No such lib found.
This error may be because the dll is not in the path.
try
1.Give full path of the dll in that function.
2.Add the path of the dll into the "PATH" environment variable. Restart msdev after this and try
nave
|
|
|
|
|
siddharthsan wrote: If i simply give like this, it's showing error as "cannot convert parameter 1 from const char to LPCWSTR",so i typecasted it as,
LoadLibrary(_T("library.dll"))
or
LoadLibrary((LPCWSTR)"library.dll"))
So the compiler is wrong and and you are making it listen by casting, right!!
|
|
|
|
|
Siddharth,
Have you tried using LoadLibraryA("library.dll") ? Your project is clearly set to use UNICODE by default and the API headers are defining LoadLibrary as LoadLibraryW. This is a bit of a strange one, I've never been quite sure what happens if you try to load a dll with the name in UNICODE (wide characters).
Note: ((LPCWSTR)"library.dll") will never work as this just casts the pointer to narrow string to a pointer to wide string but doesn't change the string
If LoadLibraryA does not work then I guess it just can't find your dll. Is it in the normal search path, i.e. same dir as exe or Windows\System32 or somewhere mentioned in the PATH environemnt variable?
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
siddharthsan wrote: LoadLibrary((LPCWSTR)"library.dll"))
if i give like this it is not taking or recognizing the library gives error as No such lib found.
Try a fully-qualified path.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
siddharthsan wrote: LoadLibrary((LPCWSTR)"library.dll"))
This is wrong. If you get into the habbit of using static_cast instead of C-style casts this kind of mistake will produce compiler errors instead of runtime errors.
Steve
|
|
|
|
|
Hi
I am making an application in VC++ 6.0 using Modal Dialog based
Problem is that when i press enter key or Press Esc Key form is closed.
Please any one told me How I avoid It.
2:
The Another Issue is In my application Backend is MySQL so
my requirment is upload .doc file in to database how can i
do it Please told me if possible with an example
Thanking You
Regard's
Kaushik
|
|
|
|
|
Y_Kaushik wrote: Please any one told me How I avoid It.
Use PreTranslateMessage()
Y_Kaushik wrote: The Another Issue is In my application Backend is MySQL so
my requirment is upload .doc file in to database how can i
do it Please told me if possible with an example
You should write some code to read from .doc file and then write the strings read into the database.
Then, Post a specific problem that you are stuck on and some one here will help you out.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Overriding PreTranslateMessage() is not the best way to do it. Read reply by Roger Stoltz, below.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
yeah. got to read that point, didn't know about this earlier
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Yeah. Didn't know about that fact earlier.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
See this[^] thread is helpfuls?
|
|
|
|
|
Y_Kaushik wrote: Problem is that when i press enter key or Press Esc Key form is closed.
Please any one told me How I avoid It.
Read this article[^] and look no further.
Why PreTranslateMessage() should be avoided can also be read in the article.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Handle OnCancel() if you dont want to close dialog and Comment CDialog::OnCancel because Enter and Esc cause OnCommand with ID as IDCANCEL.
|
|
|
|
|
Y_Kaushik wrote: Problem is that when i press enter key or Press Esc Key form is closed.
Please any one told me How I avoid It.
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I have a very strange problem concerning the sockets I use in my applications.
I have written a Server application which accepts client connections. Therefore I have created a listen socket. In the OnAccept event of that listen socket I accept the incoming connection by creating a new socket and calling its accept member. Nothing strange here and everything works well.
I'm also using ado to connect to a SQL database to write log-ins and the like. But in a single customer case the SQL server is placed on a different PC. This normally doesn't give me much trouble, but sometimes under heavy network load the database-connection to this PC is lost. In that case I close the connection and create a new one. To simulate this I have setup a test PC with SQL on and I remove this PC from the network, not my development PC. After the reconnect the PC, the connection is restored and the database can be used again
But now for the strange part. In some cases, 1 out of 5-6 test, I can't accept any new clients. Using the netstat command i can see that the port is still open. It even accept new incoming request (upto 5) but I never get in the OnAccept function so I can't accept new Clients. How come that even though the TPC-IP protocol of the machine sees the new incoming request I don't get notified any more.
Any help on this matter will be highly appreciated.
codito ergo sum
|
|
|
|
|
BadKarma wrote: I accept the incoming connection by creating a new socket and calling its accept member......In some cases, 1 out of 5-6 test, I can't accept any new clients
You call Accept() on the listening socket instance and provides a reference to the new socket as argument, right?
If not, that's what you should do. I don't know what happens if you do it the other way around.
A listening socket has a queue with pending connection requests. If I remember correctly the size of the queue is configurable by hacking registry values, but I think the default value is 5 and that's what puzzles me since you say that it's 1 out of 5-6 attempts that fails.
Are we dealing with multithreading issues here as well?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|