Search Results

Search found 584 results on 24 pages for 'mfc'.

Page 13/24 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • bitmap button not displaying in 3D style

    - by Rohit Sasikumar
    Hi, I want to display on my dialog, a bitmap button. I am using the below code CImage image; hr = image.Load(_T("myimage.png")); // just change extension to load jpg bitmap.Attach(image.Detach()); m_button.ModifyStyle(0,BS_BITMAP); m_button.SetBitmap(bitmap); This way bitmap is correctly displayed on button, but the button is not displayed in 3D style as normal buttons would look. I have set owner drawn property to false, still it displaying like this. Any ideas as to what could be wrong? Thanks, Rohit

    Read the article

  • SetCurrentDirectory timing out

    - by Callum
    Is it possible for the SetCurrentDirectory() to timeout if there is network slowdown preventing the directory from being accessed for some length of time? (In the order of 15-30 seconds...?) If so is the timeout configurable and where can it be set?

    Read the article

  • ShowWindow not working from a DLL on a 64-bit OS?

    - by Auto Roast
    I have a process that calls SetWindowsHook to catch keyboard events. In the DLL that processes the events, I conditionally call ShowWindow on the handle of the window of the process who set the hook. That code works perfectly on a 32-bit OS (XP) and as a 32-bit application on a 64-bit OS, but when compiled to 64-bit, the window is not showing. The code to make the window visible is: if (idx == passlen) { HWND h = FindWindow(NULL,windowNameToShow); ShowWindow(h,SW_SHOW); idx = 0; logger->backerase(passlen - 1); nextCharToMatch = passPointer; }

    Read the article

  • Convert CString array to System::String

    - by Anu
    Hi, I want to convert CString array to managed code ot send it to C#. For normal CString i did like this, CString menu = "MENU"; String ^ msg = gcnew String(menu); Globals1::gwtoolbar->Add(msg); But now i want to send array of string.i dont know how to do for CString array. When i gave like this it shows error CString menu[10]; String[] ^ msg = gcnew String(menu); How can i convert it?

    Read the article

  • Creating a UAC like environment

    - by Rohit
    I want to create an environment like UAC. i.e. my dialog should appear to the user and unless he responds to it, i want to disable the background. User should not be able to carry out any activity. For this purpose I created a new desktop and display my dialog on the new desktop. But i want something like UAC where the background seems disabled (or transparent??). Does anyone know how to go about it? Thanks Rohit

    Read the article

  • How to make CFileDialog synchronize the displayed filename with the selected extension?

    - by RobH
    We have a class that derives from CFileDialog that overrides the OnTypeChange() method to allow it to change the filename to keep it in synch with the selected extension whenever the user selects a new extension from the filter combobox. (Our filters are set to contain only one extension per filter entry.) Unfortunately, the way we are doing this seems to have been broken by the Vista style dialogue. (We were using SetControlText() to set the filename edit box to the filename with the newly selected extension, but the control ID seems to be different for the Vista style dialogue, and the one that I found using Spy++ works just as well as the old ID (i.e., it doesn't)..) Is there a better way to tell the CFileDialog object to update the filename field to use the new extension when the user selects a new filter? It has to work with the old XP style dialogue as well. Failing that, how to I force the use of the XP style dialogue so that I get my functionality back without the dialogue crashing on me? (I'd rather not go that route if at all possible.) I've found a way to get it to fall back to the XP style. I still want to get the new style dialogue to do what I want though.

    Read the article

  • Custom draw button using uxtheme.dll

    - by Javier De Pedro
    I have implemented my custom button inheriting from CButton and drawing it by using uxtheme.dll (DrawThemeBackground with BP_PUSHBUTTON). Everything works fine but I have two statuses (Normal and Pressed) which Hot status is the same. It means when the user places the cursor over the button it is drawn alike regardless the button status (Pressed or not). This is a bit confusing to the user and I would like to change the way the button is drawn in Pressed & Hot status. Does anybody know a way? I have also thought about custumizing the whole drawing but the buttons use gradients, borders, shadows, etc. So it is not easy to achive the same look&feel drawing everything by myself. Is there a way to find the source code of the dll or know how to do it? Thanks in advance. Javier

    Read the article

  • Using OnNcHItTest for a CWnd not CDialog

    - by dev ray
    I have a CWnd Derived object used in a dialog. I need to be able to drag it anywhere in the dialog. I have a code overriding OnNCHitTest for moving a dialog dragging it from a place other than the title bar. Is there any equivalent code to do the same to move this CWnd. The following code isnt working. UINT CBaseSliderBtn::OnNcHitTest(CPoint point) { UINT ret=CWnd::OnNcHitTest( point ); if (ret == HTCLIENT) return HTCAPTION; } If this isn't the right way, please suggest other optimum method to drag the slider. Thanks

    Read the article

  • Exception in Memset

    - by subbu
    When try to do a memset it gives the following exception "Unhandled exception at 0x1023af7d (PxSmartInterface.dll) in SendOutDllTestExe.exe: 0xC0000005: Access violation writing location 0x40e3a80e." My memset statement will look like this memset(lpStatus, 0, csStatus.GetLength());

    Read the article

  • How to write INT64 to CString

    - by sxingfeng
    I am coding in c++ windows. INT64 dirID = -1; CString querySQLStr = _T(""); querySQLStr.Format(L"select * from ImageInfo where FolderPath=%64d;", dirID); querySQLStr always like this: select * from ImageInfo where FolderPath= 1214; is it right to use %64d? Many Thanks

    Read the article

  • Exception while opening file

    - by viswanathan
    Hi I have a VC++ application and in my application i have some basic file operations. Below is the defaulting code CStdioFile cFile; CFileException e; CString sReport; CString sHtmlfile = "testreport.html" OutputDebugString((sHtmlfile)); if (!cFile.Open(sHtmlfile,CFile::modeCreate | CFile::modeWrite, &e )) { } The problem is my application executes this piece of code every few minutes. and it works fine. After several runs of the code the cFile.Open() function fails. I tried to get the error message TCHAR szError[1024]; e.GetErrorMessage(szError,1024); OutputDebugString((szError)); The irony is the szError error message is "No error occured". This again works once i restart my application. Any idea why this occurs. Thanks in advance.

    Read the article

  • How to free member (i.e BSTR, SAFEARRAY, VARIANT) of an IDL User Defined Structure which is encapsul

    - by Picaro De Vosio
    Hi, I have a structure defined in IDL. This structure has following members: { BSTR m_sFirst; BSTR m_sSecond; VARIANT m_vChildStruct; //This member encapsulate a sub structure SAFEARRAY __RPC_FAR * m_saArray; }CustomINFO; I am allocating the memory for the structs using CoTaskMemAlloc and encapsulating it in Variant as follows: vV-vt = VT_RECORD; vV-pvRecord = pStruct; //Pointer of sturct vV-pRecInfo = pRI; //RecordInfo Interface Is it enough to call VariantClear to deallocate the memory of struct and its members? Will it also release the IRecordInfo interface? Or i have to manually get the encapsulated struct and deallocate each member myself and then use CoTaskMemFree to deallocate sturct. Thanks Picaro De Vosio

    Read the article

  • Unable to view dialog box in win ce

    - by ame
    I have a win32 application (over 100 source files large) which i need to port to Win CE. I disabled the unsupported functions (such as non client area functions) and compiled the code on a Win CE platform. Now when i run it on my hardware device, I was able to resize the first couple of dialog screens to show up satisfactorily on the LCD. However there is a dialog box that has 2 option buttons and opens a new dialog box based on the choice. I am unable to view the new dialog box. Also, the close (X) button of the parent dialog box is not there and instead shows a question mark (?). I tried resizing the dialog box in the win32 code's resource compiler and it still showed up fine thus telling me that the problem did not lie with the bitmaps. I think there might be some issue with hiding the first dialog box or opening 2 at the same time. please help me. I did not code the win32 version myself and hence i am unable to locate the problem.

    Read the article

  • Problem while executing test case in VS2008 test project

    - by sukumar
    Hi all I have the situation as follows I have develpoed one test project in visual studio 2008 to test my target project. I was getting the following exception when i ran test case in my PC System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E) at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.GetType(UnitTestElement unitTest, String type) at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.ResolveMethods(). but the same project runs successfully in my colleague PC. as per my Understanding System.IO.FileNotFoundException will occur in case of missing out the dlls. i checked up with dependency walker to trace out the missed dll.dependency walke traced out the following dlls 1)MFC90D.dll 2)mSvcr90d.dll 3)msvcp90d.dll i copied this dlls to C:\windows\system32 from Microsoft visual studio 9.0 dir and again i ran the dependency walker.this time dependency walker is able to open the given testproject dll with 0 errors .even then the same exception comes up when i ran the test. i got fed up with this. can any one tell why it is behaving as PC dependent.is there any thing that i still missing? any suggestion can be helpfull Thakns in Advance Sukumar i

    Read the article

  • UpdateAllViews() from within a worker thread?

    - by Harvey
    I have a worker thread in a class that is owned by a ChildView. (I intend to move this to the Doc eventually.) When the worker thread completes a task I want all the views to be updated. How can I make a call to tell the Doc to issue an UpdateAllViews()? Or is there a better approach? Thank you. Added by OP: I am looking for a simple solution. The App is running on a single user, single CPU computer and does not need network (or Internet) access. There is nothing to cause a deadlock. I think I would like to have the worker thread post (or send) a message to cause the views to update. Everything I read about threading seems way more complicated than what I need - and, yes, I understand that all those precautions are necessary for applications that are running in multiprocessor, multiuser, client-server systems, etc. But none of those apply in my situation. I am just stuck at getting the right combination of getting the window handle, posting the message and responding to the message in the right functions and classes to compile and function at all.

    Read the article

  • CStdioFile Undeclared Identifier

    - by Eric Regnier
    I am unable to compile my code when using a CStdioFile type. I have included the afx.h header file but I am still receiving errors. What I am trying to do is write a cstring that contains an entire xml document to file. This cstring contains comments inside of it, but when I use other objects such as wofstream to write it to file, these comments are striped out for some reason. So that is why I am trying to write this to file using CStdioFile now. If anyone can help me out as to why I cannot compile my code using CStdioFile, or any other way to write a cstring that contains xml comments to file, please let me know! Below is my code using CStdioFile: CStdioFile xmlFile; xmlFile.Open( "c:\\test.txt", CFile::modeCreate | CFile::modeWrite | CFile::typeText ); xmlFile.WriteString( m_sData ); xmlFile.Close(); And my errors: error C2065: 'CStdioFile' : undeclared identifier error C2065: 'modeCreate' : undeclared identifier error C2065: 'modeWrite' : undeclared identifier error C2065: 'typeText' : undeclared identifier error C2065: 'xmlFile' : undeclared identifier error C2146: syntax error : missing ';' before identifier 'xmlFile' error C2228: left of '.Close' must have class/struct/union type type is ''unknown-type'' error C2228: left of '.Open' must have class/struct/union type type is ''unknown-type'' error C2228: left of '.WriteString' must have class/struct/union type type is ''unknown-type'' error C2653: 'CFile' : is not a class or namespace name error C2653: 'CFile' : is not a class or namespace name error C2653: 'CFile' : is not a class or namespace name error C3861: 'xmlFile': identifier not found, even with argument-dependent lookup error C3861: 'xmlFile': identifier not found, even with argument-dependent lookup error C3861: 'xmlFile': identifier not found, even with argument-dependent lookup

    Read the article

  • Storing a value in Memory Independent of Process

    - by Ganesh
    Hi, I need a way to store a value somewhere for temporarily by say Process A. Process A can exit the after storing the value in memory. After sometime Process B comes accesses the same location of memory and read the value. I need to store in memory, because I dont want the data to persistent across reboots. But as long as the system is up, it Independent of the Process the data must be accessible. I tried MailSlots and Temporary files in windows, both seem to have problem where the process reference count drops to zero , the entities dont persist in memory. What is a suitable mechanism for this in Windows preferably using Win32 API? Ganesh

    Read the article

  • OnContextMenu() not working in view class

    - by Anu
    Hi, i have a popup menu for contextmenu.And i wrote the function for each menu in CMainframe. I have OnContextMenu() in each view class and in one dialog class.Its works fine in Dialog class.But not in View class.Codings are below: CMainframe funciton: void CMainFrame::OnUpdateFptrend(CCmdUI* pCmdUI) { ((CMainFrame *)AfxGetMainWnd())->SendMessage(WM_COMMAND,ID_TRENDVIEW,NULL); } void CMainFrame::OnUpdateFptuning(CCmdUI* pCmdUI) { ((CMainFrame *)AfxGetMainWnd())->SendMessageWM_COMMAND,ID_TUNINGVIEW,NULL); } Dialog class Contextmenu: void CFacePlate::OnContextMenu(CWnd* pWnd, CPoint point) { CMenu mnuPopup; mnuPopup.LoadMenu(IDR_FPMENU); CRect rBarRect; rBarRect.left = rBarRect.top = 0; rBarRect.right = 1000;rBarRect.bottom = 300; CMenu *mnuPopupMenu = mnuPopup.GetSubMenu(0); ASSERT(mnuPopupMenu); if( rBarRect.PtInRect(point) ) mnuPopupMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this); } View class: void CGroupView::OnContextMenu(CWnd* pWnd, CPoint point) { CMenu mnuPopup; mnuPopup.LoadMenu(IDR_FPMENU); CRect rBarRect; rBarRect.left = rBarRect.top = 0; rBarRect.right = 1150;rBarRect.bottom = 390; CMenu *mnuPopupMenu = mnuPopup.GetSubMenu(0); ASSERT(mnuPopupMenu); if( rBarRect.PtInRect(point) ) mnuPopupMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this); } When i press popup menu from Faceplate(Dialogclass),it goes to Mainframe function.At the same time when i press menu from any view class,it doesnot go to Mainframe function.Why its like that?

    Read the article

  • Drag and Drop text - What am I missing?

    - by Harvey
    I am trying to add drag-and-drop text to my Doc-View App. I added the COleDropTarget variable to the view class, registered it in OnCreate(). I added OnDragEnter(), OnDragOver(), OnDragLeave() and OnDrop() to that class as virtual overrides, but none of them are ever called. I previously had added m_pMainWnd-DragAcceptFiles(TRUE); to my App class. I tried commenting out that statement, but no affect. I tried using Spy++ to see where the messages go while I do a drag, but it logs nothing at all while I am dragging the text around in the App. What do I need? Or what else can I try, to narrow down the problem? TIA, Harvey

    Read the article

  • CAsyncSocket and ThreadPool problem

    - by zabulus
    I have a server application with such structure: There is one object, call him Server, that in endless cycle listens and accepts connections. I have descendant class from CAsyncSocket, that has overriden event OnReceive, call him ProxySocket. Also I have a thread pool with early created threads. When connection is received by server object he accepts the new connection on the new object ProxySocket. When data arrives to the ProxySocket, he creates a command object and gives it to thread pool. In this command object I giving the socket handle of a ProxySocket. When new object of command is creating - I creating a new Socket in working thread and attach handle to it. My issue is next: When command ends, socket doesn't close, I just detach handle it and set CSocket handle to INVALID_SOCKET value, as planned. But my first ProxySocket object doesn't receives messages of new data receiving after that. How can I solve this?

    Read the article

  • Build error in Visual Studio application

    - by ame
    I have a solution that I am trying to build in Visual Studio which gives the following error. Project : error PRJ0019: A tool returned an error code from "Copy the executable to HAMR platform" The last few lines of the build log are as follows: Copy the executable to HAMR platform The system cannot find the path specified. Project : error PRJ0019: A tool returned an error code from "Copy the executable to HAMR platform" I understand that there may be a wrong path mentioned in the code but as there is no line number to the error I don't know how to detect the source of the problem

    Read the article

  • Set window to stays always on desktop on windows7

    - by Nuno
    Hi, I'm trying to set my window a child of the desktop, and i'm doing this like this: HWND ProgmanHwnd = ::FindWindowEx( ::FindWindowEx( ::FindWindow(L"Progman", L"Program Manager"), NULL, L"SHELLDLL_DefView", L""), NULL, L"SysListView32", L"FolderView"); SetParent(m_hWnd, ProgmanHwnd); This works fine in windowsXP, my window is underneath all windows and when i press the "show desktop" option the window shows and all other "normal" windows are hide. But in Win7 when i do the above code the same window is not displayed, in spy++ i can see that my window is a child window of the SysListView32 but it not display (and it has the WM_VISIBLE style)? What i'm missing? or what changed from winXP to win7? how can i do this to work on win7? Update: It's got something to do with aero theme, because if i change the desktop theme to the basic then the window is displayed, but if i switch back to one of the aero theme then is hided again. Thanks

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >