|
Hello All,
Currently I have developed an application using VC++ 6.0. Latter when "Developer Environment 2003" came I migrated to VC++.NET. But my code is fully like VC++ 6.0 code (I have not used .NET fully in my project)
I am planning to move this project to either C# or VC++. NET fully. I want your suggetion which will be better. Application uses MFC for GUI, Database, File operations, COM for communication between different modules and multithreading extensively. Suggest me which is better for such type of project C# or VC++.NET!!!
I want to have better GUI, easy DB Support, File oprations, easier COM communication and mainly Mulithreading and IPC should be easy. Memory leaks it is automatically taken care I can be more lazy.
Suggest me better option between 2.
Thanks
Ravi
|
|
|
|
|
It actually depends on many factors, e.g., your level of MFC. The last one you mentioned about memory management seems a critical one. To get the memory leaks taken care of automatically, you probably have to use C# or C++/CLI (managed C++).
Best,
Jun
|
|
|
|
|
For some reasons, I got a program in which create too much
CMultiDocTemplate objects. When it creates 7*15 objects, the XP can NOT create any window.
I used the MFC wizard to create a brand new projects, I wrote like this:
BOOL CTestDocTemplatesApp::InitInstance()
{
for(int i=0; i<50*14+13; ++i)
{
....
for(int i=0; i<50*14+13; ++i) // add this line to test the maximum number
{
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(IDR_TestDocTemplateTYPE,
RUNTIME_CLASS(CTestDocTemplatesDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CTestDocTemplatesView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
}
....
}
I added a 'for()' to test what is the maximum. First time I gave 200*14, the exe can not run, then I keep decrease the limit. And I got the same phenomena, XP can NOT create any more window. You can NOT open resource explore, can NOT open openfile dialog ....
I know it's very wrong to write codes like this. But I need to know why this happen. My guess is that the CMultiDocTemplate objects consume too much resource.
My question: who know the exact reason of this? or is there any articles talked about this?
Thanks a lot
|
|
|
|
|
Why would you need to create 700+ CMultiDocTemplate objects?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Only if you missed the point of what CMultiDocTemplate does.
|
|
|
|
|
I know what it does, but that does not explain the "why" in my question.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
If you look at the source code, there's no reason that it should fail.
The templates are aded to the end of a CPtrList container.
Have you debugged it to see why it doesn't work?
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Trying to load an image (bitmap/icon) to a CListCtrl.
Colors are displayed properly only in case the image is of 16 * 16 pixels
Colors of images of sizes more than 16 * 16 are not displayed properly irrespective of dpi and bit depth.
|
|
|
|
|
What view are you using in the list control? Did you specify the ILC_COLOR32 and ILC_MASK while creating the image list?
nave
|
|
|
|
|
I use Report View. Did not specify any mask or ILC_COLOR32
|
|
|
|
|
Then how did you created the image list?
nave
|
|
|
|
|
Hi!
I am storing the username and password in registry.I dont know whether its good practices or not or I have to store it somewhere else ?
I am taking the string value for both, for faster access .
but when the entry completed its show me automatic change in the binary value.
and when I am double clicking on it. it gives me the following values.
I have enter username:user
and password:password
This is for username
0000 75 73 65 72 00 user
This is for password
0000 70 61 73 73 77 6f 72 64 00 password
0008 00
I have passed const char * in the function.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
amitmistry_petlad wrote: I dont know whether its good practices or not
The location where you store this information matters less than how you store it.
Under no circumstances should a password be stored in plain text. At the very least, you should use a one-way encryption algorithm (or at least an MD5 or similar checksum) to convert the password string to something that's not obviously recognizable.
/ravi
|
|
|
|
|
when I break my program and see the stack info, I get something like this:
USER32! 77d48734()
USER32! 77d4d05b()
USER32! 77d4b4c0()
USER32! 77d4fd29()
I guest it's a name for some function, but what's the name? is it a Win API?
|
|
|
|
|
That means you are inside of user32.dll (a part of Windows operating system) which does not ship with debug info and therefore it can't show you anything more meaningful.
|
|
|
|
|
May i know which functions (other than CalcDynamicLayout())
are called (by framework) when i resize the the docking toolbar?
Thanks
|
|
|
|
|
Do i need to rephrase the question?
|
|
|
|
|
The source code has the answer.
I took a quick glance....I don't see any other (virtual) methods called but I didn't study every
line.
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hi! I have done a mini project on rekeying. I run a server and client program and communicate between the server and client. I want to design a GUI for the client side program to get input from the user. Please tell me how to do it.. It is really urgent!!
Eas
|
|
|
|
|
cool_kid_cool wrote: a GUI for the client side program to get input from the user.
That's a pretty generic description. Could you be more specific?
cool_kid_cool wrote: It is really urgent!!
It usually is.
/ravi
|
|
|
|
|
Client gets as input an integer and delivers it to the server. Server sends 4 messages to the client in response to the message from the client.
Example:
Client Side
____________
Enter Duration of Stay: 23
Server sends the following to the client in response to receiving the duration
_______________________________________________________________________________
Group Key: 1234556
Sub-Group Key: 12312312
Individual Key: 23423444
ID: 10001011
I want to design a text box to get the duration as input in the client side.. Upon clicking a button it should get sent to the server. And the keys received should be displayed in a label field.. Is it possible ?
|
|
|
|
|
This is the client side code
#include<stdio.h>
#include<sys socket.h="">
#include<iostream>
#include<netinet in.h="">
#include<stdlib.h>
#include<unistd.h>
#include<string.h>
#include<netdb.h>
#include<arpa inet.h="">
#include<sys types.h="">
#include<errno.h>
#include<time.h>
# define MAX 100
# define len 81
using namespace std;
int cwork(int);
int decrypt_rev(int);
int adding_digits(int);
int main(int argc,char **argv)
{
int sockfd,n,gk,sgk,refid;
struct sockaddr_in serv;
char str[100],str1[10],idusr[10];
if(argc != 3)
{
cout << " Error message! /n";
exit(0);
}
if((sockfd = socket(AF_INET,SOCK_STREAM,0))<0)
{
cout <<"Socket Not Created ";
exit(0);
}
bzero(&serv,sizeof(serv));
serv.sin_family = AF_INET;
serv.sin_port=htons(atoi(argv[2]));
if(inet_pton(AF_INET,argv[1],&serv.sin_addr) <= 0)
{
cout << "Conversion Error " ;
exit(0);
}
if(connect(sockfd,(struct sockaddr *) &serv,sizeof(serv)) < 0 )
{
cout << "Connect Fail";
exit(0);
}
cout << "Connected To The Server ";
int type = 0;
write(sockfd, &type, sizeof(type));
while(strcmp(str,"bye")!=0)
{
int swit;
cout << "\n\n(1)Join (2)Leave : ";// SHOULD BE A RADIO BUTTON
cin >> str1;
if(strcmp(str1,"1")==0)
{
cout << "\nEnter Duration of Stay: ";//SHOULD BE GOT IN TEXT BOX
cin >> str;
printf("\nRequest Delivered!");
write(sockfd,str1,sizeof(str1));//SENDS 1 OR 2 to SERVER
write(sockfd,str,sizeof(str));//SENDS DURATION TO SERVER
}
else
{
cout << "\nEnter ID: ";//SHOULD BE GOT IN TEXT BOX
cin >> idusr;
printf("\nRequest Delivered!");
write(sockfd,str1,sizeof(str1)); //SENDS 1 OR 2 to SERVER
write(sockfd,idusr,sizeof(idusr));//SENDS ID TO SERVER
}
int srv_msg, srv_msg1, srv_msg2,srv_msg3,xyz,xyz1,xyz2,xyzz,xyz11,xyz22;
n=read(sockfd,(char*)(&srv_msg),sizeof(srv_msg));
cout << "\nYour Individual Key: " << srv_msg << endl;//TO BE DISPLAYED ON CLIENT SIDE
gk=read(sockfd,(char*)(&srv_msg1),sizeof(srv_msg1));
xyz=adding_digits(srv_msg);
xyz1=srv_msg1+xyz;
xyz2=decrypt_rev(xyz1);
cout << "\nYour Group Key: " << xyz2 << endl; //TO BE DISPLAYED ON CLIENT SIDE
sgk=read(sockfd,(char*)(&srv_msg2),sizeof(srv_msg2));
xyzz=adding_digits(srv_msg);
xyz11=srv_msg2+xyzz;
xyz22=decrypt_rev(xyz11);
cout << "\nYour Sub Group Key: " << xyz22 << endl; //TO BE DISPLAYED ON CLIENT SIDE
read(sockfd,(char*)(&srv_msg3),sizeof(srv_msg3));
cout<<"\nYour ID: "<
|
|
|
|
|
How did you create your existing project? From the IDE, select New from the File menu. On the Projects tab, select MFC Appwizard (exe) or Win32 Application.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I created my existing code in linux.. and i dont know anything about visual studio...
|
|
|
|
|
Hi,
I have got DLL which contains an exported function of a class, and that function contains CStringArray reference as an argument, when i call that method through an application , then i get corrupted heap message. I debugged the code and found that in destructor of cstringarray on the execution of statemnet delete[] (BYTE*)m_pData; , m_pData was not pointing to a valid memory location, does any one know why it is happening.
Warm Regards,
Mushq
|
|
|
|