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
R

Royce Fickling 0

@Royce Fickling 0
About
Posts
20
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Passing multidimensional arrays to functions
    R Royce Fickling 0

    Hi, I am having a problem declaring and passing a multidimensional array of floats as an argument to a function. Can someone help me with this problem? My code is enclosed. Any help appreciated.

                float\* pData = new float\[nNumRows,2\];
    	for( int i = 0; i < nNumRows;  i++ )
    	{
    		pData\[i\]\[0\] = ((CSodSpecData\*)pOdbSpecData)->m\_cvData\[i\].Real();
    		pData\[i\]\[1\] = ((CSodSpecData\*)pOdbSpecData)->m\_cvData\[i\].Imag();
    	}
    
    	lErrorCode = pService->serviceNotifyDataEventSet( pData\[0\], strSensorName );
    
    // The function to store the data
    CDFstatus CABCDEntryPointService::serviceNotifyDataEventSet(float\* dataSet, const CString& varName)
    
    C / C++ / MFC help data-structures question

  • Browse for folder new folder path
    R Royce Fickling 0

    No, it is being called with the BFFM_INITIALIZED and BFFM_SELCHANGED messages and nothing else. I thought maybe I needed to set another flag, but I don't know what it might be.

    C / C++ / MFC question data-structures

  • Browse for folder new folder path
    R Royce Fickling 0

    I know how to use the lpfn function pointer, but I am not sure what you are suggesting. I am setting that pointer to my callback function, but it is not being called when the user is doneediting the folder name.

    C / C++ / MFC question data-structures

  • Browse for folder new folder path
    R Royce Fickling 0

    Hi, I am using the Browse For Folder dialog to allow selection of an existing folder or the creation of new folder. When the user clicks the Make New Folder button the tree allows the creation of the folder but doesn't return the folder name so that it can be shown in the status text control. How can I detect the closing of the edit control and get the new folder path? Thanks

    C / C++ / MFC question data-structures

  • CString as variable arguments
    R Royce Fickling 0

    After converting the CString reference parameters to LPCTSTR parameters, it works, but only when the optional parameters are actually passed. When they are not passed, I still get garbage in the 1st optional parameter. So how do I determine when I have them and when I don't? I thought that if the optional arguments were not passed, the first call to va_arg would return a null, but that is not the case. I have posted my code below.

    void COdb::WriteAttribute( CStdioFile& fileOutput,
    LPCTSTR strTagName,
    LPCTSTR strAttribute,
    LPCTSTR strValue, ... )
    {
    va_list vl;
    va_start( vl, strValue );

    CString strBuffer;
    strBuffer.Format( "  <%s %s=\\"%s\\"/>", 
    			strTagName, strAttribute, strValue );
    
    LPCTSTR pstrOpArg = va\_arg( vl, LPCTSTR );
    CString strOption;
    bool bAttr = true;
    while ( pstrOpArg )
    {
    	if ( bAttr )
    	{
    		strOption.Format( "%s=", pstrOpArg );
    		strBuffer += strOption;
    		bAttr = false;
    	}
    	else
    	{
    		strOption.Format( "\\"%s\\"", pstrOpArg );
    		strBuffer += strOption;
    		bAttr = true;
    	}
    
    	pstrOpArg = va\_arg( vl, LPCTSTR );
    }
    
    fileOutput.WriteString( strBuffer );
    

    }

    C / C++ / MFC question

  • CString as variable arguments
    R Royce Fickling 0

    I have a function that uses a variable argument list, but the va_arg macro always throws an exception. Why can't I use CString objects as my arguments? What am I doing wrong? My code is below.

    void COdb::WriteAttribute( CStdioFile& fileOutput,
    const CString& strTagName,
    const CString& strAttribute,
    const CString& strValue, ... )
    {
    va_list vl;
    va_start( vl, strValue );

    CString strBuffer;
    strBuffer.Format( "  <%s %s=\\"%s\\"/>", 
    			strTagName, strAttribute, strValue );
    
    CString strOpAttr = va\_arg( vl, CString );
    

    }

    C / C++ / MFC question

  • XML/XSL Books
    R Royce Fickling 0

    Is this (Professional XML) a good book for XML beginners? Thanks

    XML / XSL xml csharp java question learning

  • Multiple email addresses
    R Royce Fickling 0

    I would like to be able to post to the CodeProject forums from either my home system or my company workstation. In order to receive notification of responses regardless of which computer I post from, I would need both email addresses registered with the forum. I realize this would add some overhead for you guys to deal with, but it doesn't seem like it would be appreciable. How about it?

    Site Bugs / Suggestions question

  • Exception caught but not handled completely
    R Royce Fickling 0

    I have an exception handling problem that I don't understand. My thread function is throwing an unhandled exception which is being caught by my catch(...) handler but not completely handled. This causes my thread to be prematurely terminated so that my cleanup logic is not executed. How can I change my handler so as to completely handle the exception and execute my cleanup logic? My code is below.

    UINT CVarFileEvent::MultiFileProcessThread( LPVOID lpParam )
    {
    // This is the threaded multi-file processor. It
    // searches for and processes all VAR files in the
    // Inbox or until it is cancelled by a call from
    // DataMovement due to a Cancel message from PC-GBS.
    CVarFileEvent* pEvent = (CVarFileEvent*)lpParam;
    TRACE( "> > > > Entering CVarFileEvent::MultiFileProcessThread()\n" );

    // We must call ::CoInitialize() each time the database is accessed
    HRESULT hRes = ::CoInitialize(NULL);
    try
    {
    	vector vecVarFiles = UtilK::findAllFiles( "\*.var", 
    					pDataMovement->getInboxPath(), 
    					false );
    	TRACE( "> > > > > Beginning processing of %d VAR files\\n", 
    					(int)vecVarFiles.size() );
    
    	CDataMovement\* pDataMovement = pEvent->getDataMovementParent();
    	CFlightDataHandler FlightDataHandler( pDataMovement->getLogWriter() );
    	// run until we are cancelled or all files processed
    	for( vector::iterator iterFile = vecVarFiles.begin();
    			iterFile != vecVarFiles.end()  &&  m\_bIsThreadRunning;
    			iterFile++ )
    	{
            			FlightDataHandler.importVARFile( \*iterFile );
    		// now delete the input file and remove the event 
    		//	for this file from the queue if it exists
    		::DeleteFile( \*iterFile );
    		pDataMovement->deleteFileEvent( \*iterFile );
    	}
    }
    catch(...)
    {
    	CString strMsg( "importVARFile() failed with unexpected exception" );
    	TRACE( "> > > > CVarFileEvent::MultiFileProcessThread() exception < %s >\\n", strMsg );
    	CLogWriter\* pLogWriter = pDataMovement->getLogWriter();
    	pLogWriter->writeEntry( "CVarFileEvent", CLogWriter::LE\_OPERATION\_FAILED, strMsg );
    }
    
    // Cleanup
    ::CoUninitialize();
    // the main thread is waiting so indicate we have stopped processing
    pDataMovement->setInboxProcessEndEvent();
    m\_bIsThreadRunning = false;
    return 1;
    

    }

    Thanks

    C / C++ / MFC question database graphics data-structures debugging

  • Icon in system tray
    R Royce Fickling 0

    I have it working in dialog app, but I need to get it working in my service app.

    C / C++ / MFC help linux question

  • Icon in system tray
    R Royce Fickling 0

    The struct values are: hWnd = 0x001A0230 hIcon = 0x0001000b uID = 107 szTip = "AutoFileHandler is running" The window has a static control and a button on it. More tomorrow.

    C / C++ / MFC help linux question

  • Can't change my email address
    R Royce Fickling 0

    I am not seeing any error. It seems to let me edit my email address in both edit controls, but when I click the save button and close the window, it doesn't apply the change. When I come back and check it is still the old email address.

    Site Bugs / Suggestions question

  • Can't create tray icon from modeless dialog
    R Royce Fickling 0

    Yes, the hwnd is valid.

    C / C++ / MFC linux help question

  • Can't change my email address
    R Royce Fickling 0

    I tried to change my email address, but can't. Why?

    Site Bugs / Suggestions question

  • Can't create tray icon from modeless dialog
    R Royce Fickling 0

    This dialog must be modeless because it is to be displayed by a Windows service and I don't want my service to hang or be killed by the OS. This dialog will appear only if the user attempts to shutdown the system if my service is still doing critical processing.

    C / C++ / MFC linux help question

  • Can't create tray icon from modeless dialog
    R Royce Fickling 0

    Yes, the dialog's hwnd is valid. I have called the icon create method from OnInitDialog() after the CDialog::OnInitDialog() call. I have also called it from OnShowWindow(), but both fail.

    C / C++ / MFC linux help question

  • Can't create tray icon from modeless dialog
    R Royce Fickling 0

    Hi, I am trying to create a tray icon. I downloaded Chris Maunder's project and it works for me in my test dialog which is modal. Now I am trying to get it to work in a modeless dialog that ultimately I want to be hidden. I cannot get the tray icon create logic to work. The call to ::Shell_NotifyIcon() fails but I have no idea why. The NOTIFYICONDATA struct seems to be filled in correctly and GetLastError() returns 0. I have tried it with and without a visible modeless dialog. I need the tray icon only to let my user know that my service is running. My code is below: m_tnd.cbSize = sizeof(NOTIFYICONDATA); m_tnd.hWnd = pParent->GetSafeHwnd()? pParent->GetSafeHwnd() : m_hWnd; m_tnd.uID = uID; m_tnd.hIcon = icon; m_tnd.uFlags = NIF_ICON | NIF_TIP; // NIF_MESSAGE; m_tnd.uCallbackMessage = uCallbackMessage; _tcscpy(m_tnd.szTip, szToolTip); // Set the tray icon VERIFY(m_bEnabled = ::Shell_NotifyIcon(NIM_ADD, &m_tnd)); Any help appreciated

    C / C++ / MFC linux help question

  • Detect the plugin of USB
    R Royce Fickling 0

    How can I programmatically detect the plugin of a USB device or cable? Does anyone know of a sample code to do this? Any help appreciated.

    C / C++ / MFC question help

  • Delay Windows shutdown
    R Royce Fickling 0

    I have a Windows service in which I need to detect the Windows shutdown event and, depending on what kind of processing I am doing at the time, delay the shutdown for a few seconds until my processing is complete. Can that be done? Any help appreciated.

    C / C++ / MFC help question

  • Class not registered error
    R Royce Fickling 0

    Hi, I am trying to use the Visual SourceSafe 2005 SSAPI.DLL in a simple Windows application (C++), but I can't get around an error that indicates that the classes of the DLL are not registered. I have manually registered the DLL using the REGSVR32 utility, but I still get the error. Any help greatly appreciated.

    COM help c++ tools
  • Login

  • Don't have an account? Register

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