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
_

_crs_

@_crs_
About
Posts
27
Topics
17
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • load images without postback
    _ _crs_

    it's ok what you say but i want the image to be dynamicaly generated based on user inputs so ... if i generate the picture and save it on disk and then send the link to the client to retrieve it i will have hundrads of useless generated pictures on the server ?? my ideea was to dynamicaly generate the picture and send it to the user (the actual data) ??? can i do that ? thanks

    Web Development question sysadmin xml

  • load images without postback
    _ _crs_

    Hi, Can you plase give me a hint .... I want to load an image (jpeg) from the server generated by an aspx without postback, so i created an XMLHTTPRequest oject, I run the aspx, the responeXML is an XML and the image is base64 encoded inside a node... (i can see the string in my page) how can i display it ? So i need someking of javascipt to decode it ? Am I on the right track ? Thank you! iulian.

    Web Development question sysadmin xml

  • print problem
    _ _crs_

    hello, I have a big problem, I want to print a page (with MFC) and everything worked fine until I tried to print a colored text .... if I try to draw on printer CDC a color line or rectangle it works but with text don't ! why ?... if my color is less then RGB(255,128,0) the text is black if my color is greater the text is white ... please help ... thanks!

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

  • ADODB recordset
    _ _crs_

    hello, I want to send a pointer from my VB client app. to a VC dll the code is : for VB ------- Private Declare Sub GenerateReport Lib "Generator.dll" (ByVal datele As ADODB.Recordset) Private Sub Command1_Click() Dim con As ADODB.Connection Dim rs As ADODB.Recordset c = "PROVIDER=sqloledb;server=romulus;uid=sa;pwd=951;DataBase=SindServLast" Set con = New ADODB.Connection con.Open c Dim s As String s = "select * from T_USR_Useri" Set rs = con.Execute(s) GenerateReport rs End Sub fot VC dll ----------- void GenerateReport(_RecordsetPtr pRs) { pRs->MoveFirst(); CString text; text=(char*)((_bstr_t)pRs->Fields->GetItem((_variant_t)("usr_LoginName"))->Value); } and everything works fine in vc ... the pointer is recived correctly and the text CString is filled ok but after that when my c++ function ends and the execution returns to VB the VB client crushes ... and raise an access violation error in a vb dll ... why ? thanks !!!!!

    Visual Basic c++ database sysadmin help question

  • ADODB pointer
    _ _crs_

    if I use _RecordsetPtr *pRs it will get me compiler errors ... _RecordsetPtr it is already a pointer ... and his sizeof is 4

    C / C++ / MFC c++ database sysadmin help question

  • ADODB pointer
    _ _crs_

    hello, I want to send a pointer from my VB client app. to a VC dll the code is : for VB ------- Private Declare Sub GenerateReport Lib "Generator.dll" (ByVal datele As ADODB.Recordset) Private Sub Command1_Click() Dim con As ADODB.Connection Dim rs As ADODB.Recordset c = "PROVIDER=sqloledb;server=romulus;uid=sa;pwd=951;DataBase=SindServLast" Set con = New ADODB.Connection con.Open c Dim s As String s = "select * from T_USR_Useri" Set rs = con.Execute(s) GenerateReport rs End Sub fot VC dll ----------- void GenerateReport(_RecordsetPtr pRs) { pRs->MoveFirst(); CString text; text=(char*)((_bstr_t)pRs->Fields->GetItem((_variant_t)("usr_LoginName"))->Value); } and everything works fine in vc ... the pointer is recived correctly and the text CString is filled ok but after that when my c++ function ends and the execution returns to VB the VB client crushes ... and raise an access violation error .. why ? thanks !!!!!

    C / C++ / MFC c++ database sysadmin help question

  • CDC BitBlt problem
    _ _crs_

    hello, I have a big problem ... I have created a MFC app from wizard ... and added: void CEditorView::OnInitialUpdate() { CScrollView::OnInitialUpdate(); CSize sizeTotal; // TODO: calculate the total size of this view sizeTotal.cx = widthMM; sizeTotal.cy = heightMM; SetScrollSizes(MM_LOMETRIC, sizeTotal); } so, my maping mode is MM_LOMETRIC ... and in OnDraw .... void CEditorView::OnDraw(CDC* pDC) { CEditorDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here CDC bdc; bdc.CreateCompatibleDC(pDC); CBitmap cb; cb.CreateCompatibleBitmap(pDC, 1000,1000); bdc.SelectObject(cb); bdc.SelectStockObject(WHITE_BRUSH); bdc.PatBlt(0,0,1000, 1000, PATCOPY); bdc.SelectStockObject(BLACK_BRUSH); bdc.Rectangle(CRect(0, 0, 500, -500)); pDC->StretchBlt(0, 0, 1000, 1000, &bdc, 0, 0, 1000, 1000, SRCCOPY); } and nothing happens .... why ????? I tried to change the sign of the coordonate values and still nothing ... How can I create a compatible DC with my DC and to paint in it ????? please help !!!.... thanks ......

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

  • ComboBox in Toolbar
    _ _crs_

    Hello, I want to create a toolbar with a combobox in it and to detect when the combobox is updated !!! toolbarFont.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); toolbarFont.LoadToolBar(IDR_TOOLBARFONT); toolbarFont is a CToolbar object; I have created some buttons in toolbar (ID_BUTTONFONTSTYLE for example) and then : nIndex = toolbarFont.GetToolBarCtrl().CommandToIndex(ID_BUTTONFONTSTYLE); toolbarFont.SetButtonInfo(nIndex, ID_BUTTONFONTSTYLE, TBBS_SEPARATOR, 150); toolbarFont.GetToolBarCtrl().GetItemRect(nIndex, &rect); rect.top = 1; rect.right = 400; rect.bottom = rect.top + 250; comboFontStyle.Create(CBS_DROPDOWNLIST | CBS_SORT | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, rect, &toolbarFont, ID_BUTTONFONTSTYLE); everything works fine but how do I catch an event from the combobox ??? or any other ideea how to create it... ? thanks !

    C / C++ / MFC tutorial question

  • Toolbar in CDialog
    _ _crs_

    thanks !

    C / C++ / MFC help learning

  • Toolbar in CDialog
    _ _crs_

    hello, I have a problem ... I want to create a CDialog ... and add to it a toobar i have tried m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndToolBar.LoadToolBar(IDR_MAINFRAME); where m_wndToolBar is a member of my CDialog class and IDR_MAINFRAME is the resource ID for my toolbar and... this code is in OnInitDialog event ... the functions return OK but the toolbar isn't there .... please help ..... thanks !!!!!!

    C / C++ / MFC help learning

  • GlobalRealloc big problem ....
    _ _crs_

    hello, I have a code that raise this error "Not enough storage is available to process this command." when I try to Realloc a buffer .... temp = (DWORD)GlobalReAlloc((HGLOBAL)eyeConClients[msg - SOCKET_ID - 1].buffer, szTemp, GMEM_MOVEABLE); this works ok many times ... and randomly raise that error .... any suggestions ? please help .... thanks !!!

    C / C++ / MFC help question

  • 24Bit BITMAP
    _ _crs_

    it's cool .... ! thanks .... !!!

    C / C++ / MFC help question graphics

  • 24Bit BITMAP
    _ _crs_

    Hello, I have a problem ... I want to capture the desktop and save it in a 24Bit bitmap ... my desktop can be 256, 16bit or 32bit color. How can I do that ? It works fine if the desktop is in 24bit ... but I want to convert a HBITMAP from 256, 16bit, 32bit to 24bit ... I hope I will not have to convert it manualy by saveing it byte by byte .... I hope there is something in windows that can take care of it ... because I saw 15Bit color and God knows many these types can be and I hope I don't have to take care of all... Please if anone can help me... !!! thanks !!!

    C / C++ / MFC help question graphics

  • malloc, free problem ......
    _ _crs_

    the error is "DAMAGE: after normal block (#xx)" and a made all pointers NULL befor malloc and the same ... however I resolved with pDib by lpbi = NULL; and now it works but for iBuffer don't ! if I remove the following lines /* for (c = 0; c < iHeight * iWidth; c++) { iBufferTmp[c * 3] = iBuffer[c * 3 + 2]; iBufferTmp[c * 3 + 1] = iBuffer[c * 3 + 1]; iBufferTmp[c * 3 + 2] = iBuffer[c * 3]; }*/ everything works but ... I need them .....

    C / C++ / MFC help c++ graphics performance question

  • malloc, free problem ......
    _ _crs_

    hello, i have a problem .... a can not free memory .... i have here 3 pointers iBuffer, jByffer, pDib at the end of the function I want to free iBuffer and pDib and it's get me an error when I run the program ... if I remove the "free" lines it works fine but is not right.... what can I do ??? please if anyone can help .... thank you ! void* DDBToDIB(HBITMAP _desktopBmp, DWORD *bmpsize) { BYTE *iBuffer, *iBufferTmp; int iWidth, iHeight; void *jBuffer; int jSize; BITMAPINFOHEADER head; void *pDib; BITMAP bm; GetObject(_desktopBmp, sizeof(BITMAP), (LPSTR) &bm); iHeight = bm.bmHeight; iWidth = bm.bmWidth; DWORD dwEffWidth = ((((bm.bmBitsPixel * bm.bmWidth) + 31) / 32) * 4); if (bm.bmBitsPixel == 8) head.biClrUsed = 256; else head.biClrUsed = 0; head.biSize = sizeof(BITMAPINFOHEADER); head.biWidth = bm.bmWidth; head.biHeight = bm.bmHeight; head.biPlanes = 1; head.biBitCount = (WORD)bm.bmBitsPixel; head.biCompression = BI_RGB; head.biSizeImage = dwEffWidth * bm.bmHeight; head.biClrImportant = 0; head.biXPelsPerMeter = 0; head.biYPelsPerMeter = 0; long mypalsize = (head.biClrUsed * sizeof(RGBQUAD)); long mysize = head.biSize + head.biSizeImage + mypalsize; pDib = malloc(mysize); BITMAPINFOHEADER* lpbi; lpbi = (BITMAPINFOHEADER*)(pDib); *lpbi = head; iBufferTmp = ((BYTE*)pDib + *(DWORD*)pDib + mypalsize); HDC dc = GetDC(NULL); GetDIBits(dc, _desktopBmp, 0, iHeight, iBufferTmp, (LPBITMAPINFO)pDib, DIB_RGB_COLORS); ReleaseDC(NULL, dc); iBuffer = (BYTE *)malloc(iHeight * iWidth * 3); for (int c = iHeight - 1; c >= 0; c--) { memcpy((BYTE *)iBuffer + ((iHeight - 1 - c) * iWidth * 3), (BYTE *)iBufferTmp + (c * iWidth * 3), iWidth * 3); } for (c = 0; c < iHeight * iWidth; c++) { iBufferTmp[c * 3] = iBuffer[c * 3 + 2]; iBufferTmp[c * 3 + 1] = iBuffer[c * 3 + 1]; iBufferTmp[c * 3 + 2] = iBuffer[c * 3]; } jBuffer = (BYTE*)Compress(iBufferTmp, iWidth, iHeight, 3, &jSize, 100); FILE *dest = fopen("sent.jpg", "wb"); fwrite(jBuffer, jSize, 1, dest); fclose(dest); // free(pDib); // free(iBuffer); *bmpsize = jSize; return jBuffer; }

    C / C++ / MFC help c++ graphics performance question

  • small ques about handles
    _ _crs_

    ... if you are in DialogProc - it looks like this LRESULT CALLBACK DialogPROC(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); handle to the dialog is "hDlg" your first parameter when you create a dialog ... DialogBox(hInst, (LPCTSTR)IDD_DIALOG1, hWnd, (DLGPROC)DialogPROC); where "hInst" is the application instance, "hWnd" is a handle to parent dialog window in your case will be main window "IDD_DIALOG1" is the dialog resource id and "DialogPROC" is the dialog callback procedure (like WndProc for your main window) if you use MFC look at the other answer ....

    C / C++ / MFC question

  • small ques about handles
    _ _crs_

    hello, I don't know exactly what you want but: 1. if you are programming MFC and you need a CWnd pointer to an edit box(his resource id is for example IDC_EDIT1) or any other control in your dialog (dialog1) : dialog1.GetDlgItem(IDC_EDIT1); 2. in old windows programming style GetDlgItem(dialog1, IDC_EDIT1); where dialog1 is a handle to your dialog and IDC_EDIT1 is the resource id of the control for both functions the return value is what you want....

    C / C++ / MFC question

  • CD serial
    _ _crs_

    hello, I want to take a cd serial number like "media player" when identify an audio cd by it's serial and search the microsoft cd datbase for song titles .... Can anyone give me a hint how to take that serial ....? I suppose this serial is written by the "cd burner" ! I want to set it in Nero, burn the cd, and identify my cd later ... thanks !

    C / C++ / MFC tutorial question

  • how to create a shortcut ?
    _ _crs_

    thanks!

    C / C++ / MFC tutorial question

  • how to create a shortcut ?
    _ _crs_

    Hello, I want to create a shortcut from code and I have no idea how .... can anyone give me a hint ? tnanks !

    C / C++ / MFC tutorial 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