|
|
Hello,
I have programming in VB, C# and have done a few applications in Visual C++ 6.
But how do all these programs compare against each other. I know that C# and VB.Net are about the same as they are run in the .Net framework, so they both depend on the .Net framework. But C# allows you to have better coding syntax as it is based on C++ and java.
I was told that Visual C++ unmanaged code was better than C#, VB.Net and managed Visual C++, only if it has been coded efficiently.
My question is what type of programs would you write with each of them? I was once told that Windows operating systems 2000, ME, and XP are written in unmanaged Visual C++.
If l am wrong with any of my comments, please correct me.
Many thanks in advance.
Steve
|
|
|
|
|
You're wanting to compare apples to oranges to grapes. Why? A screwdriver is comparable to a hammer is comparable to pliers in that they are all tools and all are made of metal. Other than that, they are designed for different applications.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I think he wanted to for what kind of project you gonna use one or the other.
In my case, I coded in vb6 and vb.net, I was using those when I wanted a little program to do something basic cause it was taking me less time. Or when I was coding software wich the rapidity isn't important and when I was using Database.
Now, I am coding in visual c++ 6.0 cause I am coding real time applications, so I can't really use others. My other choice would be visualbasic cause that's the only 2 way the api I have are coded with, and it would be too slow in those case.
I also use it, for small applications now, cause I am used to code in it, so to go with vb would take me a little more time now.
For c# I don't know, I never used it yet and didn't have the time to learn it.
|
|
|
|
|
How does one limit the app to a single instance without using mfc? I can only use regular c++.
Thanks,
sb
|
|
|
|
|
Use CreateMutex() as in this example. MFC is not required.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Really appreciate the link.
many thanks,
sb
|
|
|
|
|
Hi @ all,
i have a problem. I thing for you it is an easy question.
I want to set the property of a edit box read-only!
How can i do this during the runtime? Can somebody help me?
Thanks a lot
JayJay
|
|
|
|
|
Use ModifyStyle(0, ES_READONLY, 0) , or EnableWindow(FALSE) .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
The 'EnableWindow(FALSE)' works but i want to have the font black so i can read it better.
When i take the 'ModifyStyles' nothing change!?
|
|
|
|
|
By using EnableWindow(FALSE) , you will get a box with dark gray text on a light gray background. By using SetReadOnly(TRUE) , you will get a box with black text on a light gray background. If you really want to use EnableWindow(FALSE) , you will need to override the OnCtlColor() method in the dialog. When pWnd 's control id is that of the edit control, call SetTextColor(RGB(0, 0, 0)) . Examples of this are on MSDN.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Hi all, I'm using CRecordSet for the database.
here how I open CRecordSet
<br />
CString qstr = "Select * from table1 where age=15";<br />
CDataBase db;<br />
BOOL bSuccess = db.Open(dsnName, FALSE, TRUE, TEXT("ODBC;"),FALSE);<br />
CRecordSet rs(&db);<br />
rs.Open(CRecordset::dynaset,qstr);<br />
So i have no problem getting all the data from the record. but when I want to update the table,
<br />
qstr = "Update table1 set age=12 where name='" + name + "'";<br />
rs.m_pDatabase->ExecuteSQL(qstr);<br />
I did the same thing in different program and it was working greate
but in this program.. I can't find the reason why I'm getting the following error.
<br />
"Operation must use an updateable query"<br />
If anyone of you had the same kind of situation please help me.
Thank you.
|
|
|
|
|
pnpfriend wrote:
can't find the reason why I'm getting the following error.
It's not an error. It's behaving exactly as expected when the database has been opened in read-only mode.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
hello david, thanks for your respond.
what making the database opened in read-only mode?
"dynaset" isn't read only mode right?
|
|
|
|
|
Check your code again. While the recordset was opened as updateable, the database itself wasn't.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thank you.. I didn't notice that.
the problem is solved and mission's completed.
Thank you for your help.
|
|
|
|
|
I have a "fileserver" which reads files requested by a client and delivers the data to the client via a socket. I want multiple clients to be able to use the server. I did:
while(true)
{
SOCKET new_socket_fd;
client_len = sizeof (struct sockaddr_in);
new_socket_fd = accept (socket_fd,
NULL,
&client_len);
LPVOID client = (LPVOID)&new_socket_fd;
AfxBeginThread(ServerThread,client);
}
}
THe thread talks back and forth with the client. I now run two instances of an application, each requesting a different set of files. Two threads get started, and then things are unpredictable. Sometimes one runs and one freezes, or both freeze. The threads I thought are using two different sockets so I dont understand what the problem is. Each client has its own socket.
In the thread I do stuff like:
bytes_read = recv(client, (char*)&net_req, sizeof(unsigned int), 0);
rc = send (client, (char *) &sent_size, sizeof (unsigned int), 0);
What is happening in this scenario?
Thanks,
sb
|
|
|
|
|
Maybe one of the operations, read, or send is BLOCKING(Waiting for something.) The "freeze" you mention may really be a BLOCKING action. Test for this with the debugger and make sure you return from each call to send and receive.
I hope this gives you some ideas.
Jerry
|
|
|
|
|
Is this a release or debug problem or both?
I have had some strange deadlocks while using TRACE in multiple winsock threads. Just commenting out the TRACE statements enabled the application to run perfectly. This is DEBUG only as you can expect.
However this may not be your problem. When the application deadlocks, have you tried breaking into the code to see where it is within each thread? This normally gives you some idea of what thread it waiting for what. You ought to be able to find what functions are being called at the very least.
Hope this helps
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Thanks. I will try that.
sb
|
|
|
|
|
Hi,
I have some problem regarding the reading of event from the system Event Log. I am programming in VC++ and wanted to know how to read the event description. The Windows API call ReadEventLog takes EVENTLOGRECORD as the parameter which does not have any field which returns event description. Can anybody please suggest me on this.
Any code snippets or examples would be useful.
Thanks
Abhishek.
|
|
|
|
|
What about the example that accompanies the ReadEventLog() documentation?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
The example given in the MSDN documentation does not explain/mention about how to read the description part of an event. I could not find out how to read the description part of an event. Any example or code snippet for reading the description of an event log entry would be beneficial.
Thanks,
Abhishek.
|
|
|
|
|
You need to use the EventID and SourceName members of the EVENTLOGRECORD structure to locate the file containg the description strings.
As a side exercise, you may want to scan the HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application registry key for the EventMessageFile value. This value indicates the name of the file containing the various descriptions you see in Event Viewer.
Lastly, take a look at this article, especially the ShowEventData() function.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|