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
B

basementman

@basementman
About
Posts
674
Topics
21
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Does Borland / Embarco still exist?
    B basementman

    bcc and TurboDebugger. TWindow. Good times. And, again, thanks for pointing out how old I am.

    onwards and upwards...

    The Lounge delphi question csharp c++ java

  • Just how hard is it...
    B basementman

    This is what I use: keyboard duh[^]

    onwards and upwards...

    The Lounge database question

  • Color difference between old and new application
    B basementman

    Could it be different default palettes?

    onwards and upwards...

    C / C++ / MFC csharp c++ visual-studio tutorial question

  • Upgrading an old VC application
    B basementman

    Disables warnings for "non-secure" functions such as strcpy, strcat, sprintf, etc. that have been "deprecated" due to the MS secure initiative, pushing people to strcat_s that is length validated to help prevent buffer overflows. These didn't exist in VC6.

    onwards and upwards...

    The Lounge c++ csharp tools question discussion

  • Upgrading an old VC application
    B basementman

    You probably will need to add _CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS; to your preprocessor defs to get it to compile without warnings.

    onwards and upwards...

    The Lounge c++ csharp tools question discussion

  • Client Certificates in WinHTTP
    B basementman

    I need to send a client certificate with a web request (via SSL). This client cert is just a public key. I am trying to replicate the Request.ClientCertificates.Add(Cert); .NET method using C++/WinHTTP. I am loading the .cer file successfully and setting the CERT_CONTEXT via WinHttpSetOption/WINHTTP_OPTION_CLIENT_CERT_CONTEXT. This call succeeds, but when I call WinHttpSendRequest, it fails with ERROR_WINHTTP_CLIENT_CERT_NO_PRIVATE_KEY (12185). So, the question is, how do I send a client cert public key to the server, as the ClientCertificates.Add method does in .NET? Code snippet sample below:

    BOOL HTTPCallEx::SendHTTPRequest(int iVerb /*=HTTPCALL_GET*/, LPCTSTR cpUID /*=NULL*/, LPCTSTR cpPWD /*=NULL*/)
    {
    WCHAR wcaVerb[16];
    WCHAR wcaResource[1024];

    m_dwLastError = 0;

    switch (iVerb)
    {
    case HTTPCALL_POST:
    lstrcpyW(wcaVerb,L"POST");
    break;

      case HTTPCALL\_HEAD:
         lstrcpyW(wcaVerb,L"HEAD");
         break;
         
      case HTTPCALL\_PUT:
         lstrcpyW(wcaVerb,L"PUT");
         break;
    
      case HTTPCALL\_DELETE:
         lstrcpyW(wcaVerb,L"DELETE");
         break;
    
      case HTTPCALL\_OPTIONS:
         lstrcpyW(wcaVerb,L"OPTIONS");
         break;
    
      case HTTPCALL\_TRACE:
         lstrcpyW(wcaVerb,L"TRACE");
         break;
       case HTTPCALL\_CONNECT:
         lstrcpyW(wcaVerb,L"CONNECT");
         break;
         
      case HTTPCALL\_GET:
       default:
         lstrcpyW(wcaVerb,L"GET");
         break;
     }
    

    #ifdef UNICODE
    _tcscpy(wcaResource,m_caResource);
    #else
    MultiByteToWideChar(CP_UTF8,0,m_caResource,-1,wcaResource,1024);
    #endif

    m_hRequest = WinHttpOpenRequest(m_hConnect,wcaVerb,wcaResource,NULL,WINHTTP_NO_REFERER,WINHTTP_DEFAULT_ACCEPT_TYPES,(m_bSSL ? WINHTTP_FLAG_SECURE : 0));

    if (!m_hRequest)
    {
    m_dwLastError = ::GetLastError();
    return FALSE;
    }

    if (cpUID && *cpUID)
    {
    WCHAR wcaUID[512];
    WCHAR wcaPWD[512];

    #ifdef UNICODE
    _tcscpy(wcaUID,cpUID);
    #else
    MultiByteToWideChar(CP_UTF8,0,cpUID,-1,wcaUID,512);
    #endif

      if (cpPWD && \*cpPWD)
    

    #ifdef UNICODE
    _tcscpy(wcaPWD,cpPWD);
    #else
    MultiByteToWideChar(CP_UTF8,0,cpPWD,-1,wcaPWD,512);
    #endif
    else
    wcaPWD[0] = 0;

      if (!WinHttpSetCredentials(m\_hRequest,
                                  WINHTTP\_AUTH\_TARGET\_SERVER,
                                  WINHTTP
    
    C / C++ / MFC question csharp c++ sysadmin security

  • Errors across the site
    B basementman

    Ctrl+F5 no help. IE 9/Win7 with no ad blockers, but I do have Script Error reporting turned on as show here http://qa.pubsuite.com/JunkDir/CPErrorSettings.png[^]

    onwards and upwards...

    Site Bugs / Suggestions com beta-testing help

  • Errors across the site
    B basementman

    It seems that most pages produce the following error: http://qa.pubsuite.com/junkdir/CPerror.png[^] It is really annoying and hopefully can be resolved quickly.

    onwards and upwards...

    Site Bugs / Suggestions com beta-testing help

  • Always on top (modeless) dialog box
    B basementman

    You can always create the modeless dialog via it's own UI thread. The issue is the modal dialog is preventing pumping of your messages.

    onwards and upwards...

    C / C++ / MFC wpf question

  • Performance in Microsoft SQL Server
    B basementman

    You would be much better off by using one connection and either returning multiple result sets from a stored procedure or using the MARS feature over a single connection.

    onwards and upwards...

    Database database sql-server sysadmin performance tutorial

  • Destroying ModalDialog
    B basementman

    Call EndDialog() method to have the second dialog destroyed properly.

    onwards and upwards...

    C / C++ / MFC tutorial question

  • how to create line graph in vc++?
    B basementman

    pDC->MoveTo(x,y);

    while(oPoint in points collection)
    {
    pDC->LineTo(oPoint.x,oPoint.y);
    }

    onwards and upwards...

    C / C++ / MFC c++ graphics data-structures tutorial question

  • How to make the Memory Pool thread safe ? [modified][solved]
    B basementman

    Override the new/delete operators and use "placement new" syntax to alloc in a predetermined location, managed by you.

    onwards and upwards...

    C / C++ / MFC performance tutorial question code-review

  • Drawing onto a bitmap
    B basementman

    Below is a code snippet that demonstrates creating a memory DC, calling functions that use std GDI funtions to draw onto the DC, extracting the BMP from the DC and doing something with it, and finally clean up: BOOL DoChart(CallContextObj *pCallContextObj) { CDC oMemDC; CBitmap *pOldBmp; CBitmap oBmp; long lWidth = 300; long lHeight = 200; pCallContextObj->GetParameterValue(_T("ChartWidth"),&lWidth); pCallContextObj->GetParameterValue(_T("ChartHeight"),&lHeight); CRect oBmpSize(0,0,lWidth,lHeight); oMemDC.CreateCompatibleDC(NULL); int iOldMapMode = oMemDC.SetMapMode(MM_TEXT); CWindowDC dcScreen(NULL); oBmp.CreateCompatibleBitmap(&dcScreen,oBmpSize.Width(), oBmpSize.Height()); pOldBmp = oMemDC.SelectObject(&oBmp); WORD wChartType = 88; pCallContextObj->GetParameterValue(_T("ChartType"),&wChartType); BOOL bRetval = FALSE; TCHAR caError[1024]; _tcscpy(caError,_T("Invalid Chart Type")); switch (wChartType) { case 0: bRetval = DoLineChart(pCallContextObj,&oMemDC,caError,oBmpSize); break; case 1: bRetval = DoBarChart(FALSE,pCallContextObj,&oMemDC,caError,oBmpSize); break; case 2: bRetval = DoBarChart(TRUE,pCallContextObj,&oMemDC,caError,oBmpSize); break; case 3: bRetval = DoOpenHiLowCloseChart(pCallContextObj,&oMemDC,caError,oBmpSize); break; case 4: bRetval = DoPieChart(pCallContextObj,&oMemDC,caError,oBmpSize); break; } if (bRetval) { char caHeaders[1024]; #ifdef UNICODE BYTE *cpBuf = (BYTE *)pCallContextObj->GetUTF8OutputBufferPtr(); #else BYTE *cpBuf = (BYTE *)pCallContextObj->GetOutputBufferPtr(); #endif long lQuality = 75; pCallContextObj->GetParameterValue(_T("ImageQuality"),&lQuality); long lDataSize = WriteImage(oBmp,cpBuf,pCallContextObj->GetOutputBufferSize(),caError,(DWORD)lQuality); if (lDataSize > 0) { pCallContextObj->SuppressHeaders(); sprintf(caHeaders,"Content-Type: image/jpeg\r\nContent-Length: %d\r\n\r\n",lDataSize); // write out our custom headers if (pCallContextObj->ServerSupportFunction(HSE_REQ_SEND_RESPONSE_HEADER,"200 OK",0,(LPDWORD)caHeaders) || ::GetLastError() == 10054) pCallContextObj->WriteClient((LPVOID)cpBuf,(LPDWORD)&lDataSize); *cpBu

    C / C++ / MFC graphics question

  • PPT to SWF?
    B basementman

    Thanks! I'll look into that!

    onwards and upwards...

    The Lounge c++ sysadmin tools question workspace

  • PPT to SWF?
    B basementman

    Interesting... Thanks!

    onwards and upwards...

    The Lounge c++ sysadmin tools question workspace

  • PPT to SWF?
    B basementman

    If you do, I'd be happy to beta it!

    onwards and upwards...

    The Lounge c++ sysadmin tools question workspace

  • PPT to SWF?
    B basementman

    I am trying to extract individual SWFs to pump out to a web audience on command in a webcast. Additionally, I am trying to pumping out control messages to advance the next animation on each slide. So, client-side viewers are not an option. Currently, we extract pngs of the slides and generate web pages to reference them, but they are not scalable, nor interactive with builds and animations.

    onwards and upwards...

    The Lounge c++ sysadmin tools question workspace

  • PPT to SWF?
    B basementman

    Yes, however, I need the animations/builds to display on command.

    onwards and upwards...

    The Lounge c++ sysadmin tools question workspace

  • PPT to SWF?
    B basementman

    After googling for a couple of hours for some code samples, there seems to be no suitable libraries available for generating SWF files from PPT. Yes, there are many free and nearly free desktop tools around, but I need precise control over the output, running on the server-side, in a multi-threaded environment, without relying on PPT being installed. None of these tools provide this. Anyone know of some code libraries out there that do this and are callable from C++?

    onwards and upwards...

    The Lounge c++ sysadmin tools question workspace
  • Login

  • Don't have an account? Register

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