Search Results

Search found 33 results on 2 pages for 'karikari'.

Page 1/2 | 1 2  | Next Page >

  • Sending double quote character to CreateProcess?

    - by karikari
    I want to send the double quote character to my CreateProcess function. How can I do the correct way? I want to send all of this characters: "%h" CreateProcess(L"C:\\identify -format ",L"\"%h\" trustedsnapshot.png",0,0,TRUE,NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW,0,0,&sInfo,&pInfo); Here is the full code: int ExecuteExternalFile() { SECURITY_ATTRIBUTES secattr; ZeroMemory(&secattr,sizeof(secattr)); secattr.nLength = sizeof(secattr); secattr.bInheritHandle = TRUE; HANDLE rPipe, wPipe; //Create pipes to write and read data CreatePipe(&rPipe,&wPipe,&secattr,0); STARTUPINFO sInfo; ZeroMemory(&sInfo,sizeof(sInfo)); PROCESS_INFORMATION pInfo; ZeroMemory(&pInfo,sizeof(pInfo)); sInfo.cb=sizeof(sInfo); sInfo.dwFlags=STARTF_USESTDHANDLES; sInfo.hStdInput=NULL; sInfo.hStdOutput=wPipe; sInfo.hStdError=wPipe; CreateProcess(L"C:\\identify",L" -format \"%h\" trustedsnapshot.png",0,0,TRUE,NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW,0,0,&sInfo,&pInfo); CloseHandle(wPipe); char buf[100]; DWORD reDword; CString m_csOutput,csTemp; BOOL res; do { res=::ReadFile(rPipe,buf,100,&reDword,0); csTemp=buf; m_csOutput+=csTemp.Left(reDword); }while(res); //return m_csOutput; float fvar; //fvar = atof((const char *)(LPCTSTR)(m_csOutput)); ori //fvar=atof((LPCTSTR)m_csOutput); fvar = _tstof(m_csOutput); const size_t len = 256; wchar_t buffer[len] = {}; _snwprintf(buffer, len - 1, L"%d", fvar); MessageBox(NULL, buffer, L"test print createprocess value", MB_OK); return fvar; } I need this function to return the integer value from the CreateProcess.

    Read the article

  • SSLsample in NSS

    - by karikari
    Since the latest version of NSS does not provide the SSLSample program, I copied the folder SSLSample from the older version of NSS (3.9, 3.12) to the /security/nss/cmd folder inside nss-3.12.4 . When I run make nss_build_all in my 3.12.4, the other programs generated its own binary but not my SSLSample folder. I would like to know why?

    Read the article

  • How to hide cmd.exe console?

    - by karikari
    I put this below code inside my *.dll for Internet Explorer. FILE *child = _popen("java -jar c:\\simmetrics.jar c:\\chtml.txt c:\\thtml.txt > c:\\output.txt", "r"); fclose(child); My problem is, when I run my Internet Explorer, the will be a cmd.exe console open too. I don't want the console to suddenly appear when I run my browser. How can I avoid this or hide it or not to execute it at all)?

    Read the article

  • How to put Java source inside IDE

    - by karikari
    I have a Java program source files, complete with its subdirectories. My problem is, how can I put all of this inside an IDE (ie. Netbeans, Eclipse) , so that I can easily, modify, compile and package it to become a *.jar file.

    Read the article

  • error C2065: undeclared identifier

    - by karikari
    Currently, I have this function inside my other cpp file: UINT32 functionHtml(const wchar_t *url) { WinHttpClient client(url); client.SendHttpRequest(); wstring httpResponseHeader = client.GetHttpResponseHeader(); wstring httpResponse = client.GetHttpResponse(); writeToLog(httpResponse.c_str()); return 0; } I have another cpp file, and I would like to execute the stuff inside the above file. Here is the code for the other file: HRESULT CButtonDemoBHO::onDocumentComplete(IDispatch *pDisp, VARIANT *vUrl){ ATLTRACE("CButtonDemoBHO::onDocumentComplete %S\n", vUrl->bstrVal); // <---- i would like to call funtionHTML here or .. if (isMainFrame(pDisp)){ m_normalPageLoad=false; // <---- here.. MessageBox(m_hWnd, L"Main Document has completed loading", L"Document Complete", MB_OK); return S_OK; } return S_OK; } I got the error C2065: 'url' : undeclared identifier. Need help.

    Read the article

  • fileToSTring keeps on returning " "

    - by karikari
    I managed to get this code to compile with out error. But somehow it did not return the strings that I wrote inside file1.txt and file.txt that I pass its path through str1 and str2. My objective is to use this open source library to measure the similarity between strings contains inside 2 text files. Inside the its Javadoc, its states that ... public static java.lang.StringBuffer fileToString(java.io.File f) private call to load a file and return its content as a string. Parameters: f - a file for which to load its content Returns: a string containing the files contents or "" if empty or not present Here's is my modified code trying to use the FileLoader function, but fails to return the strings inside the file. The end result keeps on returning me the "" . I do not know where is my fault: package uk.ac.shef.wit.simmetrics; import java.io.File; import uk.ac.shef.wit.simmetrics.similaritymetrics.*; import uk.ac.shef.wit.simmetrics.utils.*; public class SimpleExample { public static void main(final String[] args) { if(args.length != 2) { usage(); } else { String str1 = "arg[0]"; String str2 = "arg[1]"; File objFile1 = new File(str1); File objFile2 = new File(str2); FileLoader obj1 = new FileLoader(); FileLoader obj2 = new FileLoader(); str1 = obj1.fileToString(objFile1).toString(); str2 = obj2.fileToString(objFile2).toString(); System.out.println(str1); System.out.println(str2); AbstractStringMetric metric = new MongeElkan(); //this single line performs the similarity test float result = metric.getSimilarity(str1, str2); //outputs the results outputResult(result, metric, str1, str2); } } private static void outputResult(final float result, final AbstractStringMetric metric, final String str1, final String str2) { System.out.println("Using Metric " + metric.getShortDescriptionString() + " on strings \"" + str1 + "\" & \"" + str2 + "\" gives a similarity score of " + result); } private static void usage() { System.out.println("Performs a rudimentary string metric comparison from the arguments given.\n\tArgs:\n\t\t1) String1 to compare\n\t\t2)String2 to compare\n\n\tReturns:\n\t\tA standard output (command line of the similarity metric with the given test strings, for more details of this simple class please see the SimpleExample.java source file)"); } }

    Read the article

  • Add button to Internet Explorer toolbar during run time

    - by karikari
    I am currently create a simple additional button to my Internet Explorer 7, toolbar. The button works. I am using Visual C++. But now, I would like to create a to create a button during my Internet Explorer is running. Means, on certain condition, my program (a dll registered with regsvr32) will add a button to the toolbar. and after certain condition, the button also can be disappeared. How can I achieve this?

    Read the article

  • Scraped HTML is not written at the beginning of text file.

    - by karikari
    Currently, I'm scraping the HTML code of a page, and writing it to a text file. My problem is, why must there be empty spaces or empty lines at the beginning? The HTML codes written to the txt file do not seem to start at the beginning of the text file. This means that the '<' is not located at the position 0 of the txt file. After a few runs, my HTML is always written a few lines down inside the text file. Can anyone tell me why?

    Read the article

  • How to send value to _popen?

    - by karikari
    Hi, I have a problem here. I need to send some value to 'text1 and 'text2'. For example, text1 = ...and this code below will refer to those values.. FILE *child = _popen("java -jar c:\\simmetrics.jar text1 text2 > c:\\test.txt", "r"); How can achieve it. I have done many ways, and it keep on giving me pointer errors.

    Read the article

  • How to change *.ico for button in running mode?

    - by karikari
    I am currently doing visual c++ for an Internet Explorer toolbar button. I have a registration script file (*.rgs) that defines or maybe register the features of my button inside the Windows registry. My objective is, I want my button to change its *.ico image, based on certain conditions process from my *.cpp file. My problem is, I don't understand, how can I somehow change the *.ico file for my button in real time, during my application is running? For example, IF f = 1, ico_file = green.ico; ELSE ico_file = red.ico; Any idea, that you guys can point to me, how can I change the *.ico file for my Internet Explorer toolbar button while the IE is running.

    Read the article

  • Write to a textfile using Javascript

    - by karikari
    Under Firefox, I want to do something like this : I have a .htm file, that has a button on it. This button, when I click it, the action will write a text inside a local .txt file. By the way, my .htm file is run locally too. I have tried multiple times using this code, but still cant make my .htm file write to my textfile: function save() { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("Permission to save file was denied."); } var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath( savefile ); if ( file.exists() == false ) { alert( "Creating file... " ); file.create( Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 420 ); } var outputStream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance( Components.interfaces.nsIFileOutputStream ); outputStream.init( file, 0x04 | 0x08 | 0x20, 420, 0 ); var output = 'test test test test'; var result = outputStream.write( output, output.length ); outputStream.close(); } This part is for the button: <input type="button" value="write to file2" onClick="save();">

    Read the article

  • Scrapped HTML does not written at the beginning of text file.

    - by karikari
    Currently, I'm scraping the HTML code of a page, and write it to a txt file. My problem is, why there must be empty spaces or empty lines at the beginning? The HTML codes written to the txt file, seems does not start at the beginning of the txt file. Means, the '<' does not located at the position 0 of the txt file. After a few runs, my HTML is always written a few lines down inside the txt file. Can anyone tell me why : )

    Read the article

  • how to create button in internet explorer?

    - by karikari
    I am developing a simple c++ program inside Microsoft Visual Studio. This program will later be convert to DLL, in order to register it to Internet Explorer. Inside my program, I would like to do like this: if flag=1, toolbar_button = green; else toolbar button = red; I want to create a simple button on the Internet Explorer, and the button can reflects the color that I pass from my c++ program. How can I achieve this?

    Read the article

  • What is window message for a loaded website in Internet Explorer?

    - by karikari
    I am currently have this message handler line: MESSAGE_HANDLER(`WM_SETREDRAW`, onSetRedraw) I would like to know, is there any window message (eg: WM_???) that is connected/related to 'when a website has finish loading inside IE' ? So I can use it to replace the above WM_SETREDRAW. I want to do something like, when the IE finish loaded a website, it call onSetRedraw.

    Read the article

  • Cannot work for 2nd iteration because of writing delay.

    - by karikari
    My code's IF-THEN does not work for 2nd iteration. This is due to, the jar processing take some time to write it result inside the output.txt. Since the writing is a bit late, my code's 2nd iteration will always read the previous written value inside the output.txt in order to pass it to the IF-THEN. For example, in 1st iteration: output.txt -- 0.9888 twrite.txt -- msg: ok 2nd iteration: output.txt -- 0.5555 twrite.txt -- msg: ok //the IF-THEN still gives this result which is based on previous iteration. it should be msg: not ok . since it is < 0.7 I need help, how to solve this 'delay' problem? HRESULT CButtonDemoBHO::onDocumentComplete(IDispatch *pDisp, VARIANT *vUrl){ ATLTRACE("CButtonDemoBHO::onDocumentComplete %S\n", vUrl->bstrVal); WinHttpClient client(vUrl->bstrVal); client.SendHttpRequest(); wstring httpResponseHeader = client.GetHttpResponseHeader(); wstring httpResponse = client.GetHttpResponse(); writeToLog(httpResponse.c_str()); if (isMainFrame(pDisp)){ m_normalPageLoad=false; FILE *child = _popen("javaw -jar c:\\simmetrics.jar c:\\chtml.txt c:\\thtml.txt > c:\\output.txt", "r"); fclose(child); char readnumber[10]; float f = 0; FILE *file11 = fopen("c:\\output.txt","r"); char* p = fgets(readnumber,10,file11); std::istringstream iss(p); iss >> f; if (f > 0.7) { wfstream file12 ("c:\\twrite.txt", ios_base::out); file12 << "Msg: ok"; file12.close(); } else { wfstream file12 ("c:\\twrite.txt", ios_base::out); file12 << "Msg: not ok"; file12.close(); } iss.clear(); fclose(file11); return S_OK; } return S_OK; }

    Read the article

  • How to call java from C++

    - by karikari
    I need to run this line from my c++ program: java -jar test.jar text1 text2 the java app will give a float value and give it to the c++ program. How can I do this? I never call a java stuff before from my ms visual studio C++ file.

    Read the article

  • Need to know how to properly create a new object in another cpp file

    - by karikari
    I have a class. The problem now is, after a few attempt, I'm still in huge error. My problem is I don't know how to properly declare a new object for this class, inside another cpp file. I wanted to call/trigger the functions from this RebarHandler class from my other cpp file. I keep on getting problems like, 'used without being initialized', 'debug assertion failed' and so on. In the other cpp file, I include the RebarHandler.h and did like this: CRebarHandler *test=NULL; test->setButtonMenu2(); When compile, I does not give any error. But, when run time, it gives error and my IE crash. I need help. Below is the class I meant: #pragma once class CIEWindow; class CRebarHandler : public CWindowImpl<CRebarHandler>{ public: CRebarHandler(HWND hWndToolbar, CIEWindow *ieWindow); CRebarHandler(){}; ~CRebarHandler(); BEGIN_MSG_MAP(CRebarHandler) NOTIFY_CODE_HANDLER(TBN_DROPDOWN, onNotifyDropDown) NOTIFY_CODE_HANDLER(TBN_TOOLBARCHANGE, onNotifyToolbarChange) NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, onNotifyCustomDraw) NOTIFY_CODE_HANDLER(TBN_ENDADJUST, onNotifyEndAdjust) MESSAGE_HANDLER(WM_SETREDRAW, onSetRedraw) END_MSG_MAP() // message handlers LRESULT onNotifyDropDown(WPARAM wParam, LPNMHDR pNMHDR, BOOL& bHandled); LRESULT onNotifyToolbarChange(WPARAM wParam, LPNMHDR pNMHDR, BOOL& bHandled); LRESULT onNotifyCustomDraw(WPARAM wParam, LPNMHDR pNMHDR, BOOL& bHandled); LRESULT onNotifyEndAdjust(WPARAM wParam, LPNMHDR pNMHDR, BOOL& bHandled); LRESULT onSetRedraw(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); // manage the subclassing of the IE rebar void subclass(); void unsubclass(); void handleSettings(); void setButtonMenu2(); bool findButton(HWND hWndToolbar); private: // handles to the various things HWND m_hWnd; HWND m_hWndToolbar, m_hWndRebar, m_hWndTooltip; HMENU m_hMenu; int m_buttonID; int m_ieVer; CIEWindow *m_ieWindow; // toolbar finding functions void scanForToolbarSlow(); void getRebarHWND(); void setButtonMenu(); };

    Read the article

  • How to change button's image in visual c++ at run time?

    - by karikari
    After trying and error for many times, I decided to ask here. My objective is I wanted to change the feature of my IE toolbar button. The button is firstly setup by IE at IE startup using the function CRebarHandler::onSetRedraw and CRebarHandler::setButtonMenu2(). And then, I create a call from another cpp file, to call CRebarHandler::setButtonMenu2(). I intent to change just the button's image. I assigned the ID of the image correctly. But somehow it does not work. When I put other code inside this function,like a code for writing to file, it is proven work. Means, it is properly being called from the other file. But the thing is, the code for the button inside CRebarHandler::setButtonMenu2() seems does not work. Need help. Here is the code I am working on (I modify John Lister's button code): LRESULT CRebarHandler::onSetRedraw(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled){ bHandled=false; if (m_ieVer==6){ if (!m_hWndToolbar) scanForToolbarSlow(); if (m_hWndToolbar){ findButton(m_hWndToolbar); if (m_buttonID>0) setButtonMenu(); } } return S_OK; } void CRebarHandler::setButtonMenu(){ HIMAGELIST hImageList = ImageList_Create(32, 32,ILC_COLOR16 | ILC_MASK,1, 0); HINSTANCE module = _AtlBaseModule.GetResourceInstance(); TBBUTTONINFO inf; inf.cbSize=sizeof(inf); inf.dwMask = TBIF_IMAGE; char psBuffer[128]; FILE *pPipe; float f = 0; pPipe = _popen("javaw -jar c:\\simmetrics.jar c:\\chtml.txt c:\\thtml.txt", "rt" ); char* p = fgets(psBuffer, 128, pPipe); std::istringstream iss(p); iss >> f; if (f > 0.9) { inf.iImage = 1; SendMessage(m_hWndToolbar, TB_SETBUTTONINFO, m_buttonID, (LPARAM)(&inf)); iss.clear(); f = 0; } else { inf.iImage = 2; SendMessage(m_hWndToolbar, TB_SETBUTTONINFO, m_buttonID, (LPARAM)(&inf)); iss.clear(); f = 0; } iss.clear(); f = 0; } void CRebarHandler::setButtonMenu2(){ TBBUTTONINFO inf; inf.cbSize=sizeof(inf); inf.dwMask = TBIF_IMAGE; inf.iImage = 1; //green SendMessage(NULL, TB_SETBUTTONINFO, m_buttonID, (LPARAM)(&inf)); }

    Read the article

  • How to resolve error "Run-Time Check Failure #3"?

    - by karikari
    I am working on MS Visual Studio. I keep on getting this error: "Run-Time Check Failure #3 - The variable 'test' is being used without being initialized." I don't have any idea how to solve this. Here is the code that I'm currently tries to modify: STDMETHODIMP CButtonDemoBHO::Exec(const GUID*, DWORD nCmdID, DWORD d, VARIANTARG*, VARIANTARG* pvaOut) { CRebarHandler *test; switch (nCmdID){ case BUTTON_PRESSED: MessageBox(m_hWnd, L"You have pressed the button", L"Button Pressed", MB_OK); test->findButton(m_hWnd); test->setmenu(); break; case MENU_ITEM_SELECT: MessageBox(m_hWnd, L"You have simulated a button press with the menu ", L"Menu Pressed", MB_OK); break; } return S_OK; }

    Read the article

  • How to print a float number to visual c++ messagebox?

    - by karikari
    I have, a float number. I would like to print it inside a messagebox. How to do it? MessageBox(hWnd, "Result = <float>", L"Error", MB_OK); update: I do this and it prints out chinese characters inside the messagebox. float fp = 2.3333f; sprintf(buffer,"%f",fp); MessageBox(hWnd, LPCWSTR(buffer), L"Error", MB_OK);

    Read the article

1 2  | Next Page >