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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
A

ashish8patil

@ashish8patil
About
Posts
58
Topics
31
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to change the version number of xla project
    A ashish8patil

    I want to change the verion number of XLA project,this is existing project please help me thanks

    Visual Basic help tutorial announcement

  • problem with image scaning & displaing . win32 StretchDIBits ()
    A ashish8patil

    Hello All, General Idea:- I am developing application win32 cleint server type (It is like desktop monitoring ). On server side I am takeing screen shot. & sending it to client side. On server side I have function code like -------------------------------------------- | | |

    hdc1 = GetDC(NULL);
    hdc2 = CreateCompatibleDC(hdc1);
    GetWindowRect(GetDesktopWindow(), &rc);
    w = rc.right-rc.left;
    h = rc.bottom-rc.top;
    bmih.biSize = sizeof(BITMAPINFOHEADER);
    bmih.biWidth = w;
    bmih.biHeight = h;
    bmih.biPlanes = 1;
    bmih.biBitCount = 24;
    bmih.biCompression = BI_RGB;
    bmih.biSizeImage = ((((bmih.biWidth * bmih.biBitCount) + 31) & ~31) >> 3) * bmih.biHeight;
    bi.bmiHeader = bmih;
    aBmp = CreateDIBSection(hdc1, &bi ,DIB_RGB_COLORS, (void**)&dibvalues, NULL, NULL);
    OldObj = SelectObject(hdc2, aBmp);
    BitBlt(hdc2, 0, 0, w, h, hdc1, 0, 0, SRCCOPY);

    //////////////////////////////////////////////////////////////

    I have class like

    class DesktopScreen{
    public:
    BITMAPINFOHEADER bmih ;
    BITMAPINFO bi; unsigned char dibvalues[lenght]; };

    ------------------------------------------------------------------ using above code I am filling Object of this class & sending it to other side in binary formate (byte). On Client side deserializing is also OK (I check all value at time of debuging )

    Now at time WM_Paint:
    hDC = BeginPaint(hWnd, &Ps);

    i= StretchDIBits(hDC, // destination rectangle 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), // source rectangle 0, 0,desktopObj.bmih.biWidth , desktopObj.bmih.biHeight, desktopObj.dibvalues, &desktopObj.bi, DIB_RGB_COLORS, SRCCOPY);
    //////////////////////////////////////////////////////////////////////////

    StretchDIBits is returning 0 . Application run properlly but image is not displying. also if i call StretchDIBits on server side passing same info to that function.I mages is displaying. Can you please tell me what should be the problem. ( sorry for posting code ,but I think it is necessary to get my Question to you ) Thanks , Ashish.

    C / C++ / MFC sysadmin help question lounge

  • Problem in Sparql Query
    A ashish8patil

    Hello All , I am facing problem with following plz help me , I want to use a subquery in Spaqrl.Can anyone help me how to use subquery in Sparql.I am using WSS 3.0 version.When i tried subquery it throws me with following exception. SELECT ?shiftName WHERE{ harePointItems(?uri,?shiftName); { SELECT ?shiftName WHERE { harePointItems(?uri, "LogbookShift",?shiftInfo). } } } GROUP BY ?shiftName Exception: Intuition Data Service has failed to execute the specified SPARQL query. } expected Thanx in Advance

    Database help database tutorial question announcement

  • How to handle exception from function as we not develope that fuction() and dont kno what type of exception it will throw
    A ashish8patil

    Thanks for Reaply, But how can I get type of thown exception. whether he is throwing int,char*,of any user define data type. So that I can Identify what type of execption is occur.

    C / C++ / MFC help collaboration tutorial

  • How to handle exception from function as we not develope that fuction() and dont kno what type of exception it will throw
    A ashish8patil

    Hello All, consider following code try { function(); } catch(//what typr should expect) { } fuction is develope from other one and he not mention the type of exception he returning.. ///////////////////////////////////////////////////// if i use this code catch(std::exception & s) { cout<<s.what(); } i get error in vs2008 Error is :-- This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Please help , thanks.

    C / C++ / MFC help collaboration tutorial

  • Com Exe server
    A ashish8patil

    Thanks ,But I want to show this msg to server what should I do

    COM csharp visual-studio com sysadmin help

  • Com Exe server
    A ashish8patil

    Hello All, I am very new to com and reading it from Internet. I was making Exe server and client (both are exe). I able to do that also in Visual studio 2008. If I call class function of exe server from client i am able to do it also. NOW My Problem is ,

    STDMETHODIMP CDcomClass::GetIntVal(LONG* val)
    {
    // TODO: Add your implementation code here

    LONG i=105;
    \*val=i;
    
    printf("\\n  HI I am from Exe Server  \\n");
    
    Beep(800,800);
    

    return S_OK;
    }

    In this code I get val in client ,Beep() also run,but printf("\n HI.... is not executed . Can You please explain me reason. Thank you.

    COM csharp visual-studio com sysadmin help

  • Very Basic question in network programming
    A ashish8patil

    Hi All , I can make application for communication between two pc in same network .But I want to make this communication in following case , I have two PC PC1 and PC2 want to communicate them, PC1 is in network in one company 1, and pc2 is in network of company2 ,PC1 have ip 192.168.1.5 and its router add is 122.xxx.xxx.123 similarly PC2 have ip 192.168.1.5 and its router ip is 123.xxx.xxx.78. then how should i connect them . Thank You.

    C# sysadmin question

  • help for j2me to read /write ms word file in java mobile
    A ashish8patil

    hi all , I want to make application which will useful to me to read/write ms word file in mobile phone in j2me.And same for pdf file also .please help me if you know any hint. Thanks all.

    Mobile java help

  • GetPrivateProfileString() problem
    A ashish8patil

    thanks a lot.

    C / C++ / MFC help question

  • GetPrivateProfileString() problem
    A ashish8patil

    What is woring in my following codes run time error is occuring for both code int main() {LPTSTR strResult; LPTSTR strDefault=L"no"; DWORD d=255; GetPrivateProfileString(L"data",L"Patchcab ", strDefault,strResult,d, L"D:\\TMP\\patchpolicy.ini"); printf("%s",strResult); } int main() { LPTSTR strResult=L""; LPTSTR strDefault=L"no"; DWORD d=255; GetPrivateProfileString(L"data",L"Patchcab ",strDefault,strResult ,d,L"D:\\TMP\\patchpolicy.ini"); printf("%s",strResult); }

    C / C++ / MFC help question

  • How to install windows updates WUA api
    A ashish8patil

    Thanks for reply cab file containing many ._p Files ,manifest file, psm file

    C / C++ / MFC algorithms json help tutorial

  • How to install windows updates WUA api
    A ashish8patil

    Hello All, I am using wua api. 1)using IupdateSearcher->Searcher I am searching updates that are require, 2)After that I getting download url of respective updates. 3)using UrlDownloadToFile i am downloading .exe .cab .psf file for respective updates. Now I want to install these file to PC (.exe,.psf,.cab) how should I do please help me. I know i updates install but I want to do it above way. Thank You All, ashish p.

    C / C++ / MFC algorithms json help tutorial

  • CreateFile related
    A ashish8patil

    but logically are this things correct? LARGE_INTEGER FilePointer ; FilePointer.QuadPart =-sizeof(UpdateInfoOnServer); SetFilePointerEx ( ServerHandle , FilePointer, NULL , FILE_CURRENT ) ;

    C / C++ / MFC help tutorial

  • CreateFile related
    A ashish8patil

    i also try to do same but it was not write there plz see code ServerHandle = CreateFile ( L"server.dat" , GENERIC_READ | GENERIC_WRITE , FILE_SHARE_WRITE , NULL , OPEN_EXISTING , 0 , NULL ) ; if ( ServerHandle == INVALID_HANDLE_VALUE ) { return ( 1 ) ; } ReadFile ( ServerHandle , & finfo , sizeof ( struct ServerFileInfo ) , &BytesRead , NULL ) ; FilePointer.QuadPart =-sizeof(UpdateInfoOnServer); for (i=0;i<finfo.NoUpdates ;i++) { ReadFile ( ServerHandle , & UpdateInfo , sizeof ( struct UpdateInfoOnServer ) , &BytesRead , NULL ) ; if((UpdateInfo.IsApproved==1)&&(UpdateInfo.IsDownloaded==0) ) { for(j=0;j<UpdateInfo.NumberOfPatches ;j++) { PatchFileID=UpdateInfo.PatchFileID[j] ; iTmp=DownloadByPatchFileID(); if(iTmp==1) { return 1; } } UpdateInfo.IsDownloaded=1; SetFilePointerEx ( ServerHandle , FilePointer, NULL , FILE_CURRENT ) ; WriteFile ( ServerHandle , & UpdateInfo , sizeof ( struct UpdateInfoOnServer ) , &BytesWritten , NULL ) ; } } ///////////////////////////////////////////// where i make mistake..plz tell

    C / C++ / MFC help tutorial

  • CreateFile related
    A ashish8patil

    Thanks for your reply I just give you student as example ,but my data is very large and it may be very long way ,store that data in buffer n all..

    C / C++ / MFC help tutorial

  • CreateFile related
    A ashish8patil

    hello all , I am writing student info on file by following way.. Struct Student { int Marks; int RollNo; }; Student Sobj; int main() { //then i create file using ,CreateFile( ....); //I store data for 10 student for(int i=0;i<10;i++) { Sobj.Marks=10*i; Sobj.RollNo=i; WriteFile ( HandleFile , &sobj , sizeof ( struct Student ) ,...,...); } CloseHandle( ..) ; } -------------------------- This code work proper . Then I read that data using ReadFile(Handle,&sobj,....) it also work ----------------------------------- Now My problem is I am reading that file on some condition i want to change data of students eg. for roll no 3 marks 80; how should i do this . means i am reading and on some condition i have to Use WrteFile() i try using SetFilePointer But i was not able to do that ,,how to go back in file. Thanks All Ashish P.

    C / C++ / MFC help tutorial

  • how to change data of struture object in file
    A ashish8patil

    Hello All , Sorry i am posting all code , i this code it is writting & reading stuct data ,BUt not changing that data i want change that data #include <iostream> #include <fstream> #include <cstring> using namespace std; struct MyRecord { char name[80]; double balance; unsigned long account_num; }; int main() { struct MyRecord acc; strcpy(acc.name, "R"); acc.balance = 1.3; acc.account_num = 34; ofstream outbal("balance", ios::out | ios::binary); if(!outbal) { cout << "Cannot open file.\n"; return 1; } outbal.write((char *) &acc, sizeof(struct MyRecord)); outbal.close(); ifstream inbal("balance", ios::in | ios::binary); if(!inbal) { cout << "Cannot open file.\n"; return 1; } inbal.read((char *) &acc, sizeof(struct MyRecord)); cout << acc.name << endl; cout << "Account # " << acc.account_num; cout.precision(2); cout.setf(ios::fixed); cout << endl << "Balance: $" << acc.balance; inbal.close(); return 0; }

    C / C++ / MFC ios tutorial

  • How to change structure data written in the file. in v++
    A ashish8patil

    thanks for reply please see my new post

    C / C++ / MFC tutorial

  • How to change structure data written in the file. in v++
    A ashish8patil

    Hello All, I have structure student{ char name[10]; int id ; }; int main() { student s ; ///filling data to s //writting s to file temp.dat //reading s from temp.dat } Now i want to change s.name . what should i do thanks all.

    C / C++ / MFC tutorial
  • Login

  • Don't have an account? Register

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