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
S

Soumyadipta

@Soumyadipta
About
Posts
40
Topics
21
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Configuration Reload
    S Soumyadipta

    1. I am using a std::map to store some values of keys 2. On startup of my function i am loading values to my map 3. I am storing values to my map by a http call which is returning the key and values from a file. 4. Now i have changed my configuration file and i want to reload the config map without restarting my process 5. lots of places i am already accessing this map How safely i can reload my configurations? Please need some idea and help Regards, Samba :confused: :confused:

    C / C++ / MFC help question workspace

  • Geting MAX TEXTURE SIZE 1024 for a perticular pixel format?
    S Soumyadipta

    Different max texture size for PFD_DRAW_TO_BITMAP & PFD_DRAW_TO_WINDOW. Is there is any solution to get same max texture size? 1. I am using CreateDIBSection() for off screen rendering. 2. Which is working fine in my code as listed below. 3. But i am getting problem with textures as i am getting max texture size is 1024 4. I am getting desired 4096 texture size when i render to application window. 5. Pixel format of main application window and offscreen window is different. 6. The difference of pixel format and returned max texture size is mentioned below. How can i get 4096 max texture size for off screen window also? Getting 1024 max texture size PFD_DRAW_TO_BITMAP | PFD_SUPPORT_OPENGL | PFD_STEREO_DONTCARE, PFD_TYPE_RGBA, Getting 4096 max texture size PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, PFD_TYPE_RGBA, What pixel format should i use to get 4096 max texture size.

    bool Create(unsigned int width, unsigned int height)
    {

    // Create a p-buffer for off-screen rendering
    
    m\_uiWidth = width;
    m\_uiHeight = height;
    
    m\_hWnd = g\_pMainApplicationWindow->GetHWND();		
    
    m\_hMainApplicationWindowDC = g\_pMainApplicationWindow->GetHDC();
    m\_hMainApplicationWindowRC = g\_pMainApplicationWindow->GetHGLRC();			
    
    memset(&m\_bmi, 0, sizeof(BITMAPINFO));
    m\_bmi.bmiHeader.biSize			= sizeof(BITMAPINFOHEADER);
    m\_bmi.bmiHeader.biWidth			= m\_uiWidth;
    m\_bmi.bmiHeader.biHeight		= m\_uiHeight;
    m\_bmi.bmiHeader.biPlanes		= 1;
    m\_bmi.bmiHeader.biBitCount		= 32;
    m\_bmi.bmiHeader.biCompression	= BI\_RGB;
    m\_bmi.bmiHeader.biSizeImage		= m\_uiWidth \* m\_uiHeight \* 4;
    
    // Create DIB
    HDC	hDC = ::GetDC(m\_hWnd);
    m\_hDib = ::CreateDIBSection(hDC, &m\_bmi, DIB\_RGB\_COLORS, (void\*\*)&m\_pTextureData, NULL, (DWORD)0);
    ReleaseDC(m\_hWnd, hDC);
    
    m\_hMemDC = ::CreateCompatibleDC(NULL);
    if(!m\_hMemDC)
    {
    	DeleteObject(m\_hDib);
    	m\_hDib = NULL;
    	return (false);
    }
    
    m\_hOldDib = SelectObject(m\_hMemDC, m\_hDib);
    
    // Setup memory DC's pixel format.
    if (!SetDCPixelFormat(m\_hMemDC, PFD\_DRAW\_TO\_BITMAP | PFD\_SUPPORT\_OPENGL | PFD\_STEREO\_DONTCARE))
    {
    	SelectObject(m\_hMemDC, m\_hOldDib);
    	DeleteObject(m\_hDib);
    	m\_hDib = NULL;
    	DeleteDC(m\_hMemDC);
    	m\_hMemDC = NULL;
    	return (false);
    }
    
    m\_hRC = ::wglCreateContext(m\_hMemDC);
    if (!m\_hRC)
    {
    	SelectObject(m\_hMemDC, m\_hOldDib);
    	DeleteObject(m\_hDib);
    	m\_hDib = NULL;
    	DeleteDC(m\_hMemDC);
    	m\_hMemDC = NULL;
    	return (fal
    
    C / C++ / MFC question performance help workspace

  • How can i copy raw image buffer to a dc?
    S Soumyadipta

    Thanks for you help.But i am not understanding one thing that, if it's not possible to do this in any other way then what you are suggesting to find me in the GDI tutorials? Thanks, Soumyadipta De

    C / C++ / MFC question graphics help

  • How can i copy raw image buffer to a dc?
    S Soumyadipta

    Is there is any other alternative other than creating a bitmap? Thanks, Soumyadipta De

    C / C++ / MFC question graphics help

  • How can i copy raw image buffer to a dc?
    S Soumyadipta

    I am not getting your point.I have a 800 x 600 x 4 RGBA raw image buffer. I want to display this on current HDC. My question is should i have to create a bitmap for this buffer and then should i use bltblit () function. Curently i am able to display a bitmap on current HDC. Please elaborate your idea in little details. Thanks, Soumyadipta De

    C / C++ / MFC question graphics help

  • How can i copy raw image buffer to a dc?
    S Soumyadipta

    What is the solution for this problem?

    C / C++ / MFC question graphics help

  • How can i copy raw image buffer to a dc?
    S Soumyadipta

    I am able to display a bitmap using bltblit() function. Now i have a raw image buffer. I want to display this data to my window using the device context. I have the current HDC. should i have to create a bitmap from this raw buffer. Please help me.

    C / C++ / MFC question graphics help

  • How to displaybitmap on second monitor?
    S Soumyadipta

    I have attached two monitors two my system. Now i want to display a bitmap image on my second monitor.I am able to display a solid fill blue rectangle and able to display a text on it. How can send a bitmap image? Is it possible to send the raw image data without using the BITMAP? Below is the code:int count = 0; void CMonitorTestDlg::OnBnClickedButtonFlashAll() { CMonitor monitor; CMonitors monitors; CString cstr[2]; for ( int i = 0; i < monitors.GetCount(); i++ ) { count = i+1; monitor = monitors.GetMonitor( i ); FlashMonitor( monitor); Sleep( 500 ); } } void CMonitorTestDlg::FlashMonitor( CMonitor& monitor, bool WorkSpace) { CRect rect; if ( WorkSpace ) //get the work area rect of the monitor this window is on monitor.GetWorkAreaRect( &rect ); else monitor.GetMonitorRect( &rect ); CMonitorDC dc( &monitor ); if(count ==1) { // create and select a solid blue brush CBrush brushBlue(RGB(0, 255, 0)); CBrush* pOldBrush = dc.SelectObject(&brushBlue); rect.DeflateRect(200,200); dc.Rectangle(&rect); COLORREF clr1 = RGB(0,0,0); dc.SetTextColor(clr1); dc.DrawText("Primary Monitor",17,&rect,1); // put back the old objects dc.SelectObject(pOldBrush); } else { // create and select a solid blue brush /*CBrush brushBlue(RGB(0, 0, 255)); CBrush* pOldBrush = dc.SelectObject(&brushBlue); rect.DeflateRect(200,200); dc.Rectangle(&rect); COLORREF clr1 = RGB(0,0,0); dc.SetTextColor(clr1); dc.DrawText("Secondary Monitor",17,&rect,1); // put back the old objects dc.SelectObject(pOldBrush);*/ /*How can i send a bitmap image or a image buffer to second monitor.I have tried to use Bltblt but create compatibleDc need a CDC object not the CMonitor dc.*/ } Sleep( 2000 ); ::InvalidateRect( NULL, &rect, TRUE ); }
    Code that i have tried to send a bitmap // load IDB_BITMAP1 from our resources CBitmap bmp; if (bmp.LoadBitmap(IDB_BITMAP1)) { // Get the size of the bitmap BITMAP bmpInfo; bmp.GetBitmap(&bmpInfo); // Create an in-memory DC compatible with the // display DC we're using to paint CDC dcMemory; //dcMemory.CreateCompatibleDC(dc); // Cant do this CMonitorDC * to CDC * // Select the bitmap into the in-memory DC CBitmap* pOldBitmap = dcMemory.

    C / C++ / MFC question graphics architecture performance tutorial

  • Multiple Monitor
    S Soumyadipta

    I have already developed a application which is doing the following: 1. This a MFC dialog based application 2. It has three button "Capture","List Windows","Exit" 3. It is listing all the windows and then 4. After selecting a window and if you press capture it will capture selected window data. 5. Now i have the captured image into a buffer. Question/Probelm: 1. How can i display this buffer only in the secondary monitor? 2. Is it possible to show the output in fullscreen mode on secondary monitor. 3.How can i maintain the aspect ration of the buffer on secondary monitor if the captured data dimension is smaller than the secondary monitor resolution? Please help.

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

  • Getting problem in writing windows service [ ERROR 1053 ] [modified]
    S Soumyadipta

    How can i display a window message from my service? I am able to create and install a windows service. I am beeping a sound from my service successfully. Now i want to display a message when some event occurs.Basically in my code i am looking for a exe and checking whether it is running or not. I want to display a message "Exe not running or started/ Crashed due to some error" from my service when i found the exe is not running means when status=false.

    C / C++ / MFC help csharp visual-studio

  • [Message Deleted]
    S Soumyadipta

    [Message Deleted]

    C / C++ / MFC

  • Getting problem in writing windows service [ ERROR 1053 ] [modified]
    S Soumyadipta

    The problem is now solved.I have separated the installer code block from the existing code and have created a separate exe to install the service.I don't know the reason why the installer code block was creating the probel of ERROR 1053. Below is the installer code: /* A console program that installs our skeleton service */ /* Author :- Nishant S */ /* EMail :- nish@inapp.com */ #include #include #include void ShowErr(); int main(int argc, char* argv[]) { SC_HANDLE NishService,scm; scm=OpenSCManager(0,0,SC_MANAGER_CREATE_SERVICE); if(!scm) { ShowErr(); return 1; } NishService=CreateService(scm,"PointHDListener", "PointHDListener Service", SERVICE_ALL_ACCESS,SERVICE_WIN32_OWN_PROCESS,SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, "D:\\Service1.exe", 0,0,0,0,0); if(!NishService) { CloseServiceHandle(scm); ShowErr(); return 1; } CloseServiceHandle(NishService); CloseServiceHandle(scm); return 0; } void ShowErr() { //cout << "Error" << "\r\n"; }

    C / C++ / MFC help csharp visual-studio

  • Getting problem in writing windows service [ ERROR 1053 ] [modified]
    S Soumyadipta

    That was a silly mistake. I have corrected the code but still i am getting the same problem. Also i have downloaded the FirstService.zip from code project which is also giving me the same error message.

    C / C++ / MFC help csharp visual-studio

  • Getting problem in writing windows service [ ERROR 1053 ] [modified]
    S Soumyadipta

    I am using visual studio 2005 and i am trying to write a windows service which will basically check whether a particular exe is running or not. I have down loaded a sample code and created a service called "Service1" and i am able to successfully install and uninstall the service in to my windows XP machine with service pack 2. Problem: I cant start the service from the win service list and i am getting an error message as below. Could not start service on the local system. ERROR 1053:The service did not respond to the start or control request in a timely fashion. Below is my service code#include "stdafx.h" #include "Windows.h" #include "Winsvc.h" #include "time.h" #include "tlhelp32.h" SERVICE_STATUS m_ServiceStatus; SERVICE_STATUS_HANDLE m_ServiceStatusHandle; BOOL bRunning=true; void WINAPI ServiceMain(DWORD argc, LPTSTR *argv); void WINAPI ServiceCtrlHandler(DWORD Opcode); BOOL InstallService(); BOOL DeleteService(); bool isExeRunning(WCHAR *zExeName, bool *pbRunning); int main(int argc, char* argv[]) { if(argc>1) { if(strcmp(argv[1],"-i")==0) { if(InstallService()) printf("\n\nService Installed Sucessfully\n"); else printf("\n\nError Installing Service\n"); } if(strcmp(argv[1],"-d")==0) { if(DeleteService()) printf("\n\nService UnInstalled Sucessfully\n"); else printf("\n\nError UnInstalling Service\n"); } else { printf("\n\nUnknown Switch Usage\n\nFor Install use Srv1 -i\n\nFor UnInstall use Srv1 -d\n"); } } else { SERVICE_TABLE_ENTRY DispatchTable[]={{L"PointService",ServiceMain},{NULL,NULL}}; StartServiceCtrlDispatcher(DispatchTable); } return 0; } void WINAPI ServiceMain(DWORD argc, LPTSTR *argv) { m_ServiceStatus.dwServiceType = SERVICE_WIN32; m_ServiceStatus.dwCurrentState = SERVICE_START_PENDING; m_ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP; m_ServiceStatus.dwWin32ExitCode = 0; m_ServiceStatus.dwServiceSpecificExitCode = 0; m_ServiceStatus.dwCheckPoint = 0; m_ServiceStatus.dwWaitHint = 0; m_ServiceStatusHandle = RegisterServiceCtrlHandler(L"PointService", ServiceCtrlHandler); if (m_ServiceStatusHandle == (SERVICE_STATUS_HANDLE)0) { return; } m_ServiceStatus.dwCurrentState = SERVICE_RUNNING; m_ServiceStatus.dwCheckPoint = 0; m_ServiceStatus.dwWaitHint = 0; if (!SetServiceStatus (m_ServiceStatusHandle, &m_ServiceStatus)) { } bRunning=true; while(bRunning) { Sleep(3000);

    C / C++ / MFC help csharp visual-studio

  • Calling MeasureString from VC++ 2005
    S Soumyadipta

    So you are saying there is no way to call managed code from unmanaged code

    Managed C++/CLI c++ question graphics help

  • Calling MeasureString from VC++ 2005
    S Soumyadipta

    I am using without building a .NET project.I have used MFC application project

    Managed C++/CLI c++ question graphics help

  • Calling MeasureString from VC++ 2005
    S Soumyadipta

    I want to get the pixel width and height of a string for a particular font. I have searched the MSDN and i found the function below public: SizeF MeasureString( String^ text, Font^ font } How can i use this function in my VC++ 2005 MFC project? I have tried to use System::Drawing but failed. Please help.

    Managed C++/CLI c++ question graphics help

  • Retreiving string pixel width and height
    S Soumyadipta

    I want to get the pixel width and height of a string for a particular font. I have searched the MSDN and i found the function below public: SizeF MeasureString( String^ text, Font^ font } How can i use this function in my VC++ 2005 MFC project? I have tried to use System::Drawing but failed.

    C / C++ / MFC c++ question graphics

  • Suppressing javascript error from MFC ??
    S Soumyadipta

    1. I have created a MFC single dialog based project 2. I have inserted Microsoft WebBrowser Control Activex 3. I am now able to open any web pages But i can't suppress the javascript error. I have seen after inserting this activex control it has created a class CEXplorer1. On VB i can set a property name suppressScript error but i can't find any property when i am using VC++ and MFC. I am using visual studio 2005in windows XP with service pack 2 and have internet explorer 6.0 I have seen some tutorial they are saying i have to implement IOLECOMMANDTARGET::EXEC() i want some simple solution if possible. :(( :((

    C / C++ / MFC c++ csharp javascript visual-studio com

  • PrintWindow
    S Soumyadipta

    I want to capture client area of a transparent layered window

    C / C++ / MFC c++
  • Login

  • Don't have an account? Register

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