Search Results

Search found 1974 results on 79 pages for 'mfc serialization'.

Page 3/79 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • C++ MFC add combo box string item from a widget ID

    - by OzBarry
    I've added a combo box in the gui editor in MSVC 2010 pro in my MFC project. I have a list of strings I am grabbing from an external source and want to add them to my combo box. I've searched for a while, and every post seems to suggest I need to use the CComboBox class, however, I have no idea how to get the class variable from the resource ID of the combobox element in the gui editor. In summary, how do I add a string to my combo box, either using a macro (like CB_ADDSTRING(RESOURCE_ID, "my string");) or using CComboBOx (something like CComboBox::GetObject(RESOURCE_ID)->AddString("blah");). I do not do much win32 api/mfc programming, and just started fiddling around with it.

    Read the article

  • need help using 2 mfc projects in one solution

    - by adir
    hi, ive created the first project as mfc application and i have tried to enter the solution another project which created as mfc dll. when i running program the gui from the first solution(demodlg) is shows up. and i want that in a prss of a button in the gui the second gui(CAnalyzerDialog) will show up. i've tried a lot of options and i cant get it done right. the last option ive tried is this code : CAnalyzerDialog dlg; dlg.Create(CAnalyzerDialog::IDD); please help. thank you for your time

    Read the article

  • FILE Type Not Recognized in MFC

    - by Chicko Bueno
    I'm using FILE type in my MFC project but after compiled, it shows the following errors: Error 23 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Error 24 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Error 22 error C2146: syntax error : missing ';' before identifier 'm_pFileW' Those errors are referring to this code: FILE *m_pFileW; Did I missing any library header to use FILE syntax? Do I need to use different approach and replace FILE syntax? This errors are only generated when I placed it into my MFC project. This is not happening in C++ Console. Please help. Thank you.

    Read the article

  • Convert MFC Doc/View to?

    - by Harvey
    My question will be hard to form, but to start: I have an MFC SDI app that I have worked on for an embarrassingly long time, that never seemed to fit the Doc/View architecture. I.e. there isn't anything useful in the Doc. It is multi-threaded and I need to do more with threading, etc. I dream about also porting it to Linux X Windows, but I know nothing about that programming environment as yet. Maybe Mac also. My question is where to go from here? I think I would like to convert from MFC Doc/View to straight Win API stuff with message loops and window procedures, etc. But the task seems to be huge. Does the Linux X Windows environment use a similar kind of message loop, window procedure architecture? Can I go part way? Like convert a little at a time without rendering my program unusable for long periods of work? What is the best book to read to help me to move in that direction.

    Read the article

  • Key strokes in wpf window hosted in MFC ActiveX running in Internet Explorer

    - by user310046
    We have an MFC ActiveX control created in Visual Studio 2008 with CLR support which creates a WPF grid and shows a WPF window within that grid. This ActiveX is hosted within Internet Explorer and it shows up and works nicely except that the tab key, backspace, function keys etc. does not work since they are handeled by IE instead of the WPF window. Regular characters works nicely. This is a known feature and previously when we used to have MFC based dialogs within this ActiveX we used this: http://support.microsoft.com/kb/187988. By just using this code directly the AfxGetApp()->PreTranslateMessage((LPMSG)lParam) statement will return FALSE, so I'm not able to get the key stroke to be handled by the WPF window. I beleive I need to ask the WPF application this instead of the CWinApp, but I'm not sure how and if this can be done. Does anyone have enough understanding of what's going on here to get this to work? Using XBAP instead of ActiveX is not an option as this is run in an intranet application which needs more access than the sandbox can give us. I hope this is enough information. With best regards Svein Dybvik

    Read the article

  • Screen capture doesn't work on MFC application in Vista

    - by David Thornley
    We've got some in-house applications built in MFC, with OpenGL drawing routines. They all use the same code to draw on the screen and either print the screen or save it to a JPEG file. Everything's been working fine in Windows XP, and I need to find a way to make them work on Vista. In three of our applications, everything works. In the remaining one, I can get the window border, title bar, menus, and task bar, but the interior never shows up. As I said, these applications use the exact same code to write to the screen and capture the window image, and the only difference I see that looks like it might be relevant is that the problem application uses the MFC multiple document interface, while the ones that work use the single document interface. Either the answer isn't on the net, or I'm worse at Googling than I thought. I asked on the MSDN forums, and the only practical suggestion I got was to use GDI+ rather than GDI, and that did nothing different. I have tried different things with every part of the code that captures and prints or save, given a pointer to the window, so apparently it's a matter of the window itself. I haven't rebuilt the offending application using SDI yet, and I really don't have any other ideas. Has anybody seen anything like this?

    Read the article

  • protobuf-net NOT faster than binary serialization?

    - by Ashish Gupta
    I wrote a program to serialize a 'Person' class using XMLSerializer, BinaryFormatter and ProtoBuf. I thought protobuf-net should be faster than the other two. Protobuf serialization was faster than XMLSerialization but much slower than the binary serialization. Is my understanding incorrect? Please make me understand this. Thank you for the help. Following is the output:- Person got created using protocol buffer in 347 milliseconds Person got created using XML in 1462 milliseconds Person got created using binary in 2 milliseconds Code below using System; using System.Collections.Generic; using System.Linq; using System.Text; using ProtoBuf; using System.IO; using System.Diagnostics; using System.Runtime.Serialization.Formatters.Binary; namespace ProtocolBuffers { class Program { static void Main(string[] args) { string XMLSerializedFileName = "PersonXMLSerialized.xml"; string ProtocolBufferFileName = "PersonProtocalBuffer.bin"; string BinarySerializedFileName = "PersonBinary.bin"; var person = new Person { Id = 12345, Name = "Fred", Address = new Address { Line1 = "Flat 1", Line2 = "The Meadows" } }; Stopwatch watch = Stopwatch.StartNew(); watch.Start(); using (var file = File.Create(ProtocolBufferFileName)) { Serializer.Serialize(file, person); } watch.Stop(); Console.WriteLine(watch.ElapsedMilliseconds.ToString()); Console.WriteLine("Person got created using protocol buffer in " + watch.ElapsedMilliseconds.ToString() + " milliseconds " ); watch.Reset(); watch.Start(); System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(person.GetType()); using (TextWriter w = new StreamWriter(XMLSerializedFileName)) { x.Serialize(w, person); } watch.Stop(); Console.WriteLine(watch.ElapsedMilliseconds.ToString()); Console.WriteLine("Person got created using XML in " + watch.ElapsedMilliseconds.ToString() + " milliseconds"); watch.Reset(); watch.Start(); using (Stream stream = File.Open(BinarySerializedFileName, FileMode.Create)) { BinaryFormatter bformatter = new BinaryFormatter(); //Console.WriteLine("Writing Employee Information"); bformatter.Serialize(stream, person); } watch.Stop(); Console.WriteLine(watch.ElapsedMilliseconds.ToString()); Console.WriteLine("Person got created using binary in " + watch.ElapsedMilliseconds.ToString() + " milliseconds"); Console.ReadLine(); } } [ProtoContract] [Serializable] public class Person { [ProtoMember(1)] public int Id {get;set;} [ProtoMember(2)] public string Name { get; set; } [ProtoMember(3)] public Address Address {get;set;} } [ProtoContract] [Serializable] public class Address { [ProtoMember(1)] public string Line1 {get;set;} [ProtoMember(2)] public string Line2 {get;set;} } }

    Read the article

  • Maximized MFC window has dead region at the top

    - by John Calsbeek
    I'm trying to make a MFC window fullscreen whenever it is maximized. This window is being used to draw OpenGL content. So far it works fine—it fills the entire screen with the exception of the taskbar—but there's a dead black region at the top of the screen, 62 pixels in height. It's pretty darn close to the height of the Windows 7 taskbar, but it pretty much stays the same regardless of if the taskbar is on autohide or on a different side of the screen. When I get a CWind::OnSize callback, the height that is given is 988, which is 62 pixels short of the actual screen height (1050). I've tried to manually set the window height to 1050 with SetWindowPos, I've tried to give Windows the screen dimensions in CWnd::OnGetMinMaxInfo, and I've tried to give the screen dimensions to glViewport instead of the 988 pixels that I'm being given. None of these seem to work. I'm accomplishing the fullscreening with a call to… ModifyStyle(0, WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SYSMENU | WS_CAPTION | WS_POPUP, 0); …in the SIZE_MAXIMIZED CWnd::OnSize callback, which works fine, except for this dead region. I don't know if it's an OpenGL thing or a Win32 thing or a MFC thing. The GetClientRect function for my window reports the false 988 height. The same OpenGL rendering code works fine in my Mac OS X build. Curiously enough, I have gotten the dead region to move around a bit when I play with the taskbar (autohiding it, moving it around the screen, etc.). I've gotten the dead area to shrink to about half—not sure if the other half went to the bottom of the window or not.

    Read the article

  • Best Practices in .NET XML Serialization of Complex Classes

    This article will show you XML serialization, so simply added in code, is not a magical stick. Serialization must be planned in full detail when working with complex classes, rather than expected to work by itself. Loss of planning work leads to redesign work later on, when maintaining serialization of original classes becomes too expensive or even hits the limit after which serialization of original classes is not possible without loss of data.

    Read the article

  • Trying to convert openGL to MFC coordinates and having Problems with "gluProject"

    - by Erez
    Hi, i'm trying to find the naswer on the web and can't find a full solution that i can use and that will work... I'm developing a MFC project with static picture as the canvas for an openGL class that draw the grphics for my game. On moush down, i need to retrive a shape coordinate from the openGL class. I'm looking for a way to convert the openGL coordinates to MFC coordinates but no matter what i try i get junk after using the gluProject or gluUnProject (i've tried to do both ways but non is working) GLdouble modelMatrix[16]; glGetDoublev(GL_MODELVIEW_MATRIX,modelMatrix); GLdouble projMatrix[16]; glGetDoublev(GL_PROJECTION_MATRIX,projMatrix); int viewport[4]; glGetIntegerv(GL_VIEWPORT,viewport); POINT mouse; // Stores The X And Y Coords For The Current Mouse Position GetCursorPos(&mouse); // Gets The Current Cursor Coordinates (Mouse Coordinates) ScreenToClient(hWnd, &mouse); GLdouble winX, winY, winZ; // Holds Our X, Y and Z Coordinates winX; = (float)point.x; // Holds The Mouse X Coordinate winY; = (float)point.y; // Holds The Mouse Y Coordinate winY = (float)viewport[3] - winY; glReadPixels(winX, winY, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ); GLdouble posX=s1->getPosX(), posY=s1->getPosY(), posZ=s1->getPosZ(); // Hold The Final Values gluUnProject( winX, winY, winZ, modelMatrix, projMatrix, viewport, &posX, &posY, &posZ); gluProject(posX, posY, posZ, modelMatrix, projMatrix, viewport, &winX, &winY, &winZ); This is just part of the code i've tried. ofcourse not gluProject and gluUnProject together. just had them both here to show.....and i know there is lots of junk over there, its from some of my tries... p.s. i've tried many many more combinations and examples from the web and nothing seem to work in my case.... Can any one show me what is the right way to do the transformation? 10x

    Read the article

  • Collapsible controls in MFC (example included)

    - by John
    In the WindowsXP Control panel, you can see a nice collapsible panel control on the left: These are not just collapsible, but animated too. I wondered if these are any kind of control accessible to a developer, specifically in MFC? Or are they custom/bespoke functionality?

    Read the article

  • Using MFC classes inside ATL Project

    - by user196614
    Hi, I have created an ATL Project with all default options using VC++ 2008. I have added Simple ATL object (interface IDemo) and some interface moethos inside the simple object. I want to use MFC classes (e.g. CDatabase, CRecordset and lots more) inside my ATL project. How can I achieve this? Thanks.

    Read the article

  • Crash Reporting Utility for Windows 7, MFC Application

    - by nimo
    hi, I'm having a MFC application (VS 2008) which is going to be deployed on Windows 7 machine. I need to distribute my application with debugging information, so that a debugable core will be generated in case of application crash event. Can somebody please let me know how can I achieve this purpose ? I have read about minidump utility, just would like to whether there is a better way of generating coredump on windows 7 machine Thank you

    Read the article

  • MFC: Reading entire file to buffer...

    - by deostroll
    I've meddled with some code but I am unable to read the entire file properly...a lot of junk gets appended to the output. How do I fix this? // wmfParser.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "wmfParser.h" #include <cstring> #ifdef _DEBUG #define new DEBUG_NEW #endif // The one and only application object CWinApp theApp; using namespace std; int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { int nRetCode = 0; // initialize MFC and print and error on failure if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)) { // TODO: change error code to suit your needs _tprintf(_T("Fatal Error: MFC initialization failed\n")); nRetCode = 1; } else { // TODO: code your application's behavior here. CFile file; CFileException exp; if( !file.Open( _T("c:\\sample.txt"), CFile::modeRead, &exp ) ){ exp.ReportError(); cout<<'\n'; cout<<"Aborting..."; system("pause"); return 0; } ULONGLONG dwLength = file.GetLength(); cout<<"Length of file to read = " << dwLength << '\n'; /* BYTE* buffer; buffer=(BYTE*)calloc(dwLength, sizeof(BYTE)); file.Read(buffer, 25); char* str = (char*)buffer; cout<<"length of string : " << strlen(str) << '\n'; cout<<"string from file: " << str << '\n'; */ char str[100]; file.Read(str, sizeof(str)); cout << "Data : " << str <<'\n'; file.Close(); cout<<"File was closed\n"; //AfxMessageBox(_T("This is a test message box")); system("pause"); } return nRetCode; }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >