Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
K

Kashif Manzoor

@Kashif Manzoor
About
Posts
18
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Calling Other DLLS from VC application
    K Kashif Manzoor

    Appologies for not posting this on VC++ message board ( the link was timing out) I am trying to call a DLL written in Fortran from my VC++ application. Everything works fine, but when the Fortran DLL runs into trouble (some exception occurs in the FOrtran DLL) I see a dangerous looking Dialog Box, given the stack trace and the VC application simply exits. I have tried enclosing Fortran DLL function call with both try-catch and __try__except blocks, but the code in the catch/except never gets executed. Is there any way to catch Exceptions raised in FOrtran DLL in the calling VC++ applications. Any help will be greatly appreciated. cheers, kashif manzoor peace to all

    COM c++ data-structures debugging help

  • New to this whole .NET thing
    K Kashif Manzoor

    You may want to check out the following articles : Introduction to .NET and Introduction to CLR cheers, -kashif manzoor peace to all

    .NET (Core and Framework) c++ csharp help question announcement

  • whats wrong here?
    K Kashif Manzoor

    Rafi, This error occurs for two reasons: (1) if you are sacing the file differently than loading it e.g.: if (ar.IsStoring()) { // storing code ar << someVariable; } else { // loading code, is trying to read a variable that was not saved. // So obviously you are trying to read past the file and ar >> someVariable>>anotherVariable; } (2) if you are readin/loading a file that was saved by some other program then there is a strong chance that such an error will occurr (again this is related to reason (1) (3) If you save the data using Serialize(&ar), and load/read the data using ar>> operator then you will again get the mentioned error. I think your problem is related to category (1). Make sure you are reading exactly the same (and also in the same order) that you wrote. Normally I simply copy the saving code in the loading block and simply change the << to >>, to avoid any mistake. -cheers, kashif manzoor peace to all

    C / C++ / MFC question csharp c++ html com

  • how do we fix this?
    K Kashif Manzoor

    Your teacher wants you to read two topics: (1) operator overloading (2) polymorphism Although I personally can give you a complete answer to your question (as I have given similar question to my students) but I believe that if you simply read the above mentioned topics you would be able to solve the problem yourself. Basically the "Stock" object has an implementation of "<<" operator that outputs the conctenated string containing the attributes of Stock object The "Stocks" object will have its own "<<" which uses the "<<" of Stock to produce a consolidated string that shows the details of ALL the stocks. You have already noticed that the return from with in the loop will give you an error. Since you for () condition is not properly shown (due to HTML format) i can't really see why u are returning from with in the loop - because this way your loop will only run once (but i guess u already know this). -cheers, kashif manzoor peace to all

    C / C++ / MFC question data-structures help tutorial

  • Problem getting to Event Procedure for a SubClassed Control
    K Kashif Manzoor

    I sort of lost you in the last paragraph where you have defined your problem. Are you trying to call a message handler function through direct function call ? If this being the problem then rather than calling the function directly - you must use PostMessage() (see MSDN help on PostMessage() ) to invoke the event handler. PostMessage() a parameter that contains the MESSAGE_ID, LPARAM, and WPARAM If i incorrectly understood the problem then can you please elaborate it further -cheers -kashif manzoor peace to all

    C / C++ / MFC help c++ question workspace

  • One simple question =>
    K Kashif Manzoor

    To send a message use // see help of PostMessage for parameter options #define WM_GENNIE_LEARN_MODE 2000 // use any id as you desire PostMessage(WM_GENNIE_LEARN_MODE); Now in the message map of the class where you want the message to be captured (namely the parent class in your case) make an entry in the BEGIN_MESSAGE_MAP section as given below IMPLEMENT_DYNCREATE(..., ...) BEGIN_MESSAGE_MAP(... , ...) //{{AFX_MSG_MAP(CDict1View) ON_MESSAGE(WM_GENNIE_LEARN_MODE,OnGennieLearnMode) //}}AFX_MSG_MAP END_MESSAGE_MAP() Now declare the handler function, as given below //{{AFX_MSG(CDict1View) afx_msg LRESULT OnGennieLearnMode(WPARAM wParam, LPARAM lParam); //}}AFX_MSG DECLARE_MESSAGE_MAP() and define it as LRESULT YourParentClassName::OnGennieLearnMode(WPARAM wParam, LPARAM lParam) { // blah blah blah ... return ...; } /**********************/ The above code will send a message WM_GENNIE_LEARN_MODE to the parent window where it would be handled by the function OnGennieLearnMode(). In your case you would sen the DBLCLICK message, and handle it in your own handler function. hope it helps, -cheers -kashif manzoor peace to all

    C / C++ / MFC question tutorial

  • The promised bronze rating ????
    K Kashif Manzoor

    thanx for the clarification, -cheers kashif peace to all

    The Back Room tutorial question

  • How to remove this small error with sprintf
    K Kashif Manzoor

    include "stdafx.h" before including anything else i.e. move #include "stdafx.h" statement to the top and you won't get the error message -cheers -kashif manzoor peace to all

    C / C++ / MFC help tutorial

  • How to minimize an application using CPropertySheet to the systray
    K Kashif Manzoor

    Assuming that you have already overridden the OnClose() method (WM_CLOSE message) and want to hide the application again here's what you should do. /* get the handle of the application and simply hide through the code similar to the pne given below. Since your application icon already exists in the taskbar you need not put it there again. Simply hiding the main window should do the trick*/ ::ShowWindow(GetParent()->GetSafeHwnd(), SW_HIDE); hope it helps, -kashif manzoor peace to all

    C / C++ / MFC c++ help tutorial question

  • How to minimize an application using CPropertySheet to the systray
    K Kashif Manzoor

    Can u explain as to which one of them is your problem : (1) How to catch the CLOSE message, so that you can properly override it according to your needs? or (2) You have already overriden the close function and want to know how to minimize the application to the taskbar again ? -kashif peace to all

    C / C++ / MFC c++ help tutorial question

  • Parallel cable connection
    K Kashif Manzoor

    In case there's no cross-over ethernet cable available you could fall back on a bus network. just keep two terminators handy peace !!!!

    The Lounge help sysadmin hardware

  • How much time......
    K Kashif Manzoor

    your article does not appear in your profile. You do have 176 messages though. This means that the article was not properly submitted. Try submitting the article again, through the submission wizard. Once submitted the article would immediately appear as [unedited]. As for moving it from [unedited] to [edited] well I don't know about it. May be one of the CP pros could help us out here. Software Engineer (Techlogix (pvt)ltd) Visiting Faculty Informatics, Lahore

    The Back Room question

  • The promised bronze rating ????
    K Kashif Manzoor

    ya, that's the sad part of the story. I am loosing my faith in humanity - there ain't no justice in this X| -kashif Software Engineer (Techlogix (pvt)ltd) Visiting Faculty Informatics, Lahore

    The Back Room tutorial question

  • The promised bronze rating ????
    K Kashif Manzoor

    can anyone tell me how to get ur status changed from unrated to atleast bronze. The footnote says that a message posting automatically guarantees atleast a bronze rating --- but somehow its not keeping its promise. any ideas ? -kashif manzoor Software Engineer (Techlogix (pvt)ltd) Visiting Faculty Informatics, Lahore

    The Back Room tutorial question

  • How much time......
    K Kashif Manzoor

    Your article should appear immediately as an [unedited] article. If u don't c it then may b you did not submit it properly. Try using the submission wizard -cheers Software Engineer (Techlogix (pvt)ltd) Visiting Faculty Informatics, Lahore

    The Back Room question

  • Image-map like graphics in VC++ dialogs?
    K Kashif Manzoor

    One solution could be to use Bitmapped buttons. Explore CBitmapButton, CBitmapButton.AutoLoad() and other related functions. Basically uyou would first create a Bitmap to be put on the button. Now create the button on your dialog box, using VC++ Visual Editor - check the "Owner Draw" and "Bitmap" options for the button. In Caption give the same name as the name of the bitmap. If the bitmap was named "FIND" then your button caption should read FIND. Give the ID for the button e.g. ID_FIND. Now before displaying the Dialog declare a member variable CBitMapButton find; find.AutoLoad(ID_FIND, this); I am telling you thus from the top of my head, so the information should be treated as a pointer to the right direction and not as an absolute solution :) Software Engineer (Techlogix (pvt)ltd) Visiting Faculty Informatics, Lahore

    Article Writing question c++ graphics tutorial

  • winsock file transfer
    K Kashif Manzoor

    Kuniva, Please see the attached sample code of a Winsock client. With a little bit of improvisation and MFC socket programming knowledge you could easily change it to your needs. /***************************************/ /* This is the sample code for a client that send and receives some data from a server.*/ DownloadFileFromInternet(CString strAddress) { char buff[1024]; int s; struct sockaddr_in a; struct hostent *h; WSADATA wsaData; int SERVER_PORT = 1223;// The server port to which the client will connect. // This call initializes the Winsock.dll WSAStartup(0x101, &wsaData); // Initializing the sockaddr_in datastructer with all zeroes. memset(&a,0,sizeof(a)); // First assume an Internet dotted form address e.g. 198.168.0.1 a.sin_family = AF_INET; a.sin_port = htons(SERVER_PORT); // Connect to the server port a.sin_addr.s_addr = inet_addr("127.0.0.1"); // Connect to the localhost. Replace this address with the IP address of the server. ///////////////////////////////////////////// // You may use descriptive Internet (e.g. www.microsoft.com) instead of the dotted (e.g. 127.0.0.1) one. h = gethostbyname("www.microsoft.com"); // change this address to the desired server's address. if (h != NULL) { a.sin_addr.s_addr = ((LPIN_ADDR)h->h_addr)->s_addr; } else { AfxMessageBox("Cannot resolve hostname\n"); WSACleanup(); return FALSE; } // create the socket. s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (s == 0) { AfxMessageBox("Cannot establish connection: "); WSACleanup(); // Winsock.dll cleanup code return FALSE; } // socket succesfully created, now we may connect to the server if (connect(s, (struct sockaddr *)&a, sizeof(a))) { //Can not establish the connection to the server WSACleanup(); return FALSE; } // Connection established with the server. Start receiving data from the server int k=0; k = recv(s, buff, 1024, 0); if (k<0) { // An error occurred while trying to receive data closesocket(s); // close the opened socket. WSACleanup(); // clean up Winsock.dll return FALSE; } buff[k] = '\0'; // we will NULL terminate the received data from the server. // We will send "WA-ALIKUMASALAM" to the server. k=0; while (k < int(strlen("WA-ALIKUMASALAM"))) { // keep sending until all the data is sent. k = send(s,"WA-ALIKUMASALAM",strlen("WA-ALIKUMASALAM"),0); } // We are finished. Now its time to

    Article Writing c++ tutorial

  • disable close button in child window
    K Kashif Manzoor

    Another possible (brute force) method could be to OverLoad OnClose function (the message WM_CLOSE) in CMainFrame class. void CMainFrame::OnClose() { // Call the default implementation if you want the close functionality if (close_allowed) { CMDIFrameWnd::OnClose(); } // else do nothing } Software Engineer (Techlogix (pvt)ltd) Visiting Faculty Informatics, Lahore

    C / C++ / MFC question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups