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
N

narayanagvs

@narayanagvs
About
Posts
124
Topics
100
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Apply DS_SYSMODAL style when creating a dialog at runtime
    N narayanagvs

    Hi, I need to apply DS_SYSMODAL style while creating a modeless dialog at runtime based on a registry key setting.And also undo this style from dialog at runtime. When DS_SYSMODAL is set, Windows is internally setting it to WS_EX_TOPMOST. Now Can anyone tell me how I should do the same. I have used ModifyStyleEx as below but it didnt seem to have any impact. if(blnSysModal) { m_dlg1->ModifyStyleEx(0,WS_EX_TOPMOST); } else { m_dlg1->ModifyStyleEx(WS_EX_TOPMOST,0); } Any help on the same would be appreciated. Thanks Satya

    Today is a gift, that's why it is called the present.

    C / C++ / MFC windows-admin help

  • [HttpWebRequest_WebException_RemoteServer]
    N narayanagvs

    Hi, I have a Silverlight application where in the browser which loads a WCFClient dll requests the data from a server a WCFService dll.The IE has many graphic elements on the browser window which are populated with the data retrieved from the WCFService. The issue here is the server is throwing the below exception when the the number of graphic elements configured exceeds.Also the data is not populated in these graphic elements.

    [HttpWebRequest_WebException_RemoteServer]
    Arguments: NotFound
    Debugging resource strings are unavailable...

    Going through the below blog http://forums.silverlight.net/t/133801.aspx/3/10[^] observed that the issue could be with the following tag configured in my WCFService projects Web.config file

    Could any one of you please tell me how to go about fixing this issue? Thanks Satya

    Today is a gift, that's why it is called the present.

    WPF csharp sysadmin help tutorial question

  • How to replace a '%' character in CComBSTR with "%%"?
    N narayanagvs

    Hi I just wanted to replace a '%' character in CComBSTR with "%%". But the code does not support CString. The solution should be UNICODE support. Any methods to perform this operation ? Thanks In Advance. Babu

    Today is a gift, that's why it is called the present.

    COM tutorial question

  • How to replace a '%' character in CComBSTR with "%%"
    N narayanagvs

    Hi I just wanted to replace a '%' character in CComBSTR with "%%". But the code does not support CString. The solution should be UNICODE support. Any methods to perform this operation ? Thanks In Advance. Babu

    Today is a gift, that's why it is called the present.

    ATL / WTL / STL tutorial question

  • Problem with Painting logic
    N narayanagvs

    Hi, In my application I have a window in which there are few buttons below the window and on clicking each of the buttons Activex controls from a list with certain conditions are shown in the same window above these buttons .This is done using painting logic.The Problem I am having here is there are prev screen left overs when I swiitch between button clicks. This bug appears only once when I open the window and do the button clicks.If at all I Minimize and Maximize my window atleast once this bug doesn't appear and every works fine. I face the issue only when I use DeviceindependentBitmap to Bitblt.I assume the problem is with clipregions. Please suggest me on the same. Below is the snippets of code

    case WM_PAINT:{
    RECT rc;
    HDC hdcMem, hdcOld;
    HBRUSH hbrBkGnd;
    HFONT hfntOld;
    PAINTSTRUCT ps;
    DWORD dwConnectState;

    	// Don't bother Processing any WM\_PAINT messages if you are in the process of 
    	// shutting down Window.
    	if(! bViewClosing )	 
    	{
    	// Get the window update region before calling BeginPaint. 
    	// Note: The BeginPaint function automatically validates the update region, so any call 
    	// to GetUpdateRgn made immediately after the call to BeginPaint retrieves an empty update 
    
    	region. 
    	if(hClipRgn == NULL)
    	{
    		hClipRgn = CreateRectRgn(0,0,0,0);
    		GetUpdateRgn(hWnd, hClipRgn, FALSE);
    	}
    	ws = (WIN\_STRUCTPTR) GetWindowLong( hWnd, 0 );
    	BeginPaint(hWnd, (LPPAINTSTRUCT)&ps);
    
    	// Get the size of the client rectangle.
    	GetClientRect(hWnd, &rc);
    
    	// Create a compatible DC.
    	hdcMem = CreateCompatibleDC(ps.hdc);
    
    	bool createFailed = false;
    
    	// Create a DIBSection big enough for our client rectangle.
    	long width = rc.right-rc.left;
    	long height = rc.bottom-rc.top;
    	//Start of CRL00107461 
    	HWND dDeskWnd = GetDesktopWindow();
    	HDC hdc= GetDC(dDeskWnd);
    	int nBitCount = GetDeviceCaps(hdc,BITSPIXEL);
    	if (hbmDIBSection == NULL || dibSectionWidth < width || dibSectionHeight < height)
    	{
    		if (hbmDIBSection != NULL)
    			DeleteObject(hbmDIBSection);
    		
    		BITMAPINFO bmi = {0};
    		bmi.bmiHeader.biSize        = sizeof(BITMAPINFOHEADER);
    		bmi.bmiHeader.biWidth       = width;
    		bmi.bmiHeader.biHeight      = height;
    		bmi.bmiHeader.biPlanes      = 1;
    	    bmi.bmiHeader.biBitCount    = nBitCount;//32;       // 32 bits per pixel.//CRL00107461
    		bmi.bmiHeader.biCompression = BI\_RGB;
    		bmi.bmiHeader.biSizeImage   = bmi.bmiHeader.biWidth \* bmi.bmiHeader.biHeight \* 4; 
    

    // 4

    C / C++ / MFC help com announcement

  • Problem with doublebyte chars in Japanese
    N narayanagvs

    Sure .. say with a text having 6 double byte chars as below and if I try to find word My then my search is displaced by 6 chars and the pos is returned at "th" " DIM a;DIM b;{ ‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨‚ ‚¢‚¤‚¦‚¨ } My Month " using ascii version functions in my code

    len = lstrlen(lpSrc)+1; //Error Length is returned as 6 extra bytes

    _fstrstr( lpStr, (LPSTR)szFind );

    if( p ) {

    pos = p - lpStr;   
    

    }

    Using MBCS functions

    len = _mbslen((unsigned char *)lpSrc)+1; // Length is correctly returned
    ucP = _mbsstr((unsigned char *)lpStr, (unsigned char *)(LPSTR)szFind );

    if(ucP)
    {
    pos = ucP - (unsigned char *)lpStr; // Error here the difference is 6 extra bytes
    }

    This problem happens only in japanese OS and that too in my application's editor. Removing the XP manifest file from my application folder seems to work fine. Doing a sample application of the same and testing in both english and japanese OS is working fine. Now I am changing my code to MBCS and then counting the double byte chars in my code and adjusting the position accordingly using below code.

    int cPos = 0,count =0;
    while(cPos<pos)
    {
    if( IsDBCSLeadByte(lpStr[cPos] ))
    {
    cPos = cPos + 2;
    count++;
    }
    else
    cPos++;
    }
    pos = pos - count;

    Thanks Satya

    Today is a gift, that's why it is called the present.

    C / C++ / MFC help c++ com security debugging

  • Problem with doublebyte chars in Japanese
    N narayanagvs

    Hi, I have an editor in my application which has a find functionality implemented for it.The user will enter text in the editor and will try the Find option from menu.The problem is when I have n double byte characters(of japanese) in my text and say if I try to find an char or word which after the double byte chars then my search is displaced by n bytes.This issue happens only in japanese and the same application works fine in English.Going through the below blog which has a similar problem as that of mine I noticed that the problem is with the dependancy on ComCtrl 6 dll used in xp manifest theme. http://www.insidercoding.com/post/2008/08/06/Visual-C2b2b-60-2b-XP-Manifest-3d3d-Problems.aspx My application is also developed in vc6 and we use a manifest file for XP visual theme as below

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="X86"
    name="wm"
    type="win32"/>
    <description>Merely an XP test.</description>
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
    <requestedPrivileges>
    <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
    </requestedPrivileges>
    </security>
    </trustInfo>
    <dependency>
    <dependentAssembly>
    <assemblyIdentity
    type="win32"
    name="Microsoft.Windows.Common-Controls"
    version="6.0.0.0"
    processorArchitecture="X86"
    publicKeyToken="6595b64144ccf1df"
    language="*"
    />
    </dependentAssembly>
    </dependency>
    </assembly>

    And I also cannot move my application to unicode. There are ASCII functions in my code.MFC by default supports MBCS.Even after placing _MBCS in project settings doesnt solve my problem. When I debug the below code I found the problem with lstrlen which is returning n chars extra for n double byte chars in my text to find.This happens only when I debug the code in japanese OS , the same works fine when I debug the same application in English OS.

    static
    int
    FindStrPos( LPSTR lpSrc, LPSTR lpFind, BOOL bMatchCase )
    {
    LPSTR p;
    int pos = -1, len;
    char szFind[FIND_LEN];

    LPSTR lpStr;

    lstrc

    C / C++ / MFC help c++ com security debugging

  • Include file for using _contolfp_s
    N narayanagvs

    Hi, I need to use _contolfp_s function in vc6 to set the floating point control word. I have already used _controlfp and it is working fine

    #include "float.h"
    _controlfp(_CW_DEFAULT, 0xFFFFF);

    but it seems this is deprecated function and I have to use the new _contolfp_s. But using this _contolfp_s gives an error undelared identifier as it is checking in the path C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\float.h I have to Include the below path for my vc6 application C:\Program Files\Microsoft Visual Studio 8\VC\include\float.h Where should I Include this? Thanks Satya

    Today is a gift, that's why it is called the present.

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

  • How to call a function when dll is statically loaded?
    N narayanagvs

    Hi, I have a third party dll which actually is corruping fpcw register.Due to this my application crashes upon being launched. I also have the code to fix, this is just a call to _controlfp() function.And I want to call it immediately after the third party dll is loaded.I want to put my fix in any of the dlls which get loaded after this one.Where can I call this code as all of these dlls are loaded statically? Any suggestions would be helpful. Thanks Satya

    Today is a gift, that's why it is called the present.

    C / C++ / MFC help tutorial question

  • Get the ipaddress of a system which remotely logged into my system
    N narayanagvs

    Hi, In my application, I need to check whether my system is remotely connected and if connected I need to get the ipaddress of the remote system. Any suggestions or links would be helpful. Thanks Satya

    Today is a gift, that's why it is called the present.

    C / C++ / MFC

  • making a modelessdialog box as modal
    N narayanagvs

    I just want to know. This is a question asked to me. Satya

    Today is a gift, that's why it is called the present.

    C / C++ / MFC question

  • making a modelessdialog box as modal
    N narayanagvs

    Hi, Thanks for the reply. But I also dont want my mainframe window to receive messages.I want the exact behaviour of DoModal. Thanks Satya

    Today is a gift, that's why it is called the present.

    C / C++ / MFC question

  • making a modelessdialog box as modal
    N narayanagvs

    Hi, I have an MDI application.I create an a Modeless dialog on a menu click.I would like to make it behave like a Modal dialog box. How should I do that? Thanks Satya

    Today is a gift, that's why it is called the present.

    C / C++ / MFC question

  • Unable to View the MDI Static Splitter
    N narayanagvs

    Hi, I have taken an MDI application and overriden the Childframe's OnCreateClient

    if (!m_mdiSplitWnd.CreateStatic(this, 2, 2,WS_CHILD | WS_VISIBLE|AFX_WS_DEFAULT_VIEW ))
    {
    TRACE0("Failed to CreateStaticSplitter\n");
    return FALSE;
    }
    m_mdiSplitWnd.CreateView(0,0,RUNTIME_CLASS(CMyEditView),CSize(100,100),pContext);
    m_mdiSplitWnd.CreateView(0,1,RUNTIME_CLASS(CSpreadSheetview),CSize(100,100),pContext);
    m_mdiSplitWnd.CreateView(1,0,RUNTIME_CLASS(CSpreadSheetview),CSize(100,100),pContext);
    m_mdiSplitWnd.CreateView(1,1,RUNTIME_CLASS(CSpreadSheetview),CSize(100,100),pContext);
    RecalcLayout();

    After running the application I am unbale to find a splitter in the childwnd ,hovering my mouse on I could notice the Splitters panes and Spreadsheet Ax Control in one of the views are partially visible.Also I could notice the splitter window is not sized when my childframe is maximized. What Should I do to make my splitter window clearly visible and also to be resized with respect to childframe? Thanks Satya

    Today is a gift, that's why it is called the present.

    C / C++ / MFC question

  • Query related to DllInstall()
    N narayanagvs

    Hi, I have a third party dll which I registered with /i option. Like regsvr32 /i:"someGUID" "DllPath" .registration succeeded. I could notice that With /i option DllInstall function is also called with DllRegisterServer. Now for me to use this dll I should call a function of it with the "someGUID" which it compares and returns successfully. 1)I would like to know what it does internally? Where does it store the GUID for comparing? The dll has some function which takes strings(file paths) as input. and displays as a list when we call another function of it. Now I close my application and register the same third party dll with another GUID to use it in another application.I have repeated the above process. When I got the list of all strings that it has it also shows the strings which it stored from the first application.I tried to find them in registry and also for any text files in the directory where the dll resides but of know use. 2)I would like to know where else can we save strings in windows other than files and registries. Thanks Satya

    Today is a gift, that's why it is called the present.

    C / C++ / MFC

  • Automatically Start Windows Service on Startup [modified]
    N narayanagvs

    Hi, I would like to create a windows service which automatically starts on startup and calls my function.I dont want to use .NET support for this. Using ATL I have taken a windows service project.I build it and registered the service using "/Service" which is then shown in Services with "Manual Startup type". I would want this to be automatic. How should I go about it? For this while creating the service we need to specify "SERVICE_AUTO_START" flag. But this service creation is automatically done by the base class CAtlServiceModuleT.

    SC_HANDLE hService = ::CreateService(
    hSCM, m_szServiceName, m_szServiceName,
    SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
    SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL,
    szFilePath, NULL, NULL, _T("RPCSS\0"), NULL, NULL);

    Now How should I go about overriding the base class functions. I know I need to make use of _tWinMain() and override but Iam not sure of the approach. Any suggestions or relevant links would be helpful Thanks Satya

    Today is a gift, that's why it is called the present.

    modified on Tuesday, October 7, 2008 4:17 AM

    ATL / WTL / STL csharp c++ question

  • How to Include MFC Datatypes in IDl ?
    N narayanagvs

    Hi, I need to pass MFC Class "CStringArray" as Parameter in my exposed method in com component. When I Compile I get 2 errors 1)#error MFC requires C++ compilation (use a .cpp suffix) 2)command line error MIDL1003 : error returned by the C preprocessor (2)midl Can Anybody suggest me how to go about it? Thanks Satya

    Today is a gift, that's why it is called the present.

    COM c++ com help tutorial question

  • How to get LoginNames of all Users in my Domain?
    N narayanagvs

    Hi I would like get LoginNames of all users in My Domain. I could get the list of all user names in my domain using IADS and IDirectorySearch using the article [^] Can any body suggest me relevant approach or provide me any links for solving this? Thanks Satya

    Today is a gift, that's why it is called the present.

    C / C++ / MFC com tutorial question

  • Unable to Capture Incoming Mail Event in Outlook
    N narayanagvs

    Hi, I have added an outlook addin project.Everything works fine. Whenever I receive a mail an Incoming mail event needs to be fired and hence I do my processing further. This works fine when the outlook is opened.But when my outlook is closed and if I receive the mails in the mean time, again when I open the outlook the "Incoming mail event" is not fired for all the new mail messages. What could be the problem? How Should I handle this ? Any Suggestions would be helpful. Thanks Satya

    Today is a gift, that's why it is called the present.

    C# help question

  • Unable to Capture Incoming Mail Event in Outlook
    N narayanagvs

    Hi, I have added an outlook plugin project.Everything works fine. Whenever I receive a mail an Incoming mail event needs to be fired and hence I do my processing further. This works fine when the outlook is opened.But when my outlook is closed and if I receive the mails in the mean time, again when I open the outlook the "Incoming mail event" is not fired for all the new mail messages. What could be the problem? How Should I handle this ? Any Suggestions would be helpful. Thanks Satya

    Today is a gift, that's why it is called the present.

    Visual Basic help 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