Hi there, I came across this strange thing, i don't know how to handle it. Maybe a pretty stupid question or a case of RTFM - but i couldn't find any refference... Following code works just fine: WebClient webClient = new WebClient(); webClient.Headers.Add("Content-Type","application/x-www-form-urlencoded"); webClient.Headers.Add("abc", "123"); byte[] postArray = Encoding.UTF8.GetBytes("submitting some data here..."); byte[] responseArray = webClient.UploadData("MyServer", postArray); Console.WriteLine("Response received was : " + Encoding.ASCII.GetString(responseArray)); Console.Read();
BUT if i change the HTTP Header to something like webClient.Headers.Add("abc[OBJECT_ID]", "123");
i get an error in the next line (byte[] postArray...) saying: An unhandled exception of type 'System.ArgumentException' occurred in system.dll So it's the square brackets causing the issue. Do i need to escape them in any way??? thanks in advance, - ajs
mightyCoCo
Posts
-
webClient.Headers.Add(string key, string value) behaves strange if 'key' has a square bracket in it? ([]) -
obtaining app-icon of another processthats it! thanks a lot! :o) hIcon = (HICON)::SendMessage(hwnd, WM_GETICON, ICON_BIG, 0); if(hIcon == NULL) hIcon = (HICON)::GetClassLong(hwnd, GCL_HICON); if(hIcon == NULL) hIcon = (HICON)::GetClassLong(::GetParent(hwnd), GCL_HICON); works - no just looking when hIcon is still NULL, if there is a ICON_SMALL :o) cheers and thanx vertex_x
-
obtaining app-icon of another processyou ment AfxGetApp()? that works only on your own created process as far as i know... i don´t know a way to do something linke CWnd::AfxGetApp()->... also ::AfxGetApp is no function in the global namespace... thanks 4 reading ;o) cheers, arné
-
obtaining app-icon of another processhello, what i have is a list of all open windows and running processes. i have a hwnd to each window and its processid. all what i need - i thought. my problem is, i want to list all running tasks in a listbox and show each window´s icon in the listbox... but how to get the icon? i used attached the handle to the window with an CWnd and called hIcon = pWnd.GetIcon(true); - after that i detached that handle from the CWnd... but it only work at 2 apps ;o) so: how to get ann icon of another running process/window??? i searched the net all the night and didn´t found any interesting articles... cheers, vertex_x
-
get the actual selected file in windows explorer???with the above functions i get only messages if something is changed - eg. file rw-access, folder creation/delet, media insertion/remov and so on... but thanks anyway ;o) it was a good tray :o) cheers, vertex
-
get the actual selected file in windows explorer???thanx alot! i actually can´t find any documentation about them, even not in my msdn-library ;o) looking now on msdn in the net for it ;o) i´ll notice here, if it works... cheers, vertex
-
get the actual selected file in windows explorer???of course, thats right. but excessive right-clicking and popping windows takes to much time for me. i just want to cycle through a lot of files and directly see some type of preview... without draging files to a preview window or starting applikations via right-click...
-
get the actual selected file in windows explorer???hi, following problem: i trace the actual front window with GetForegroundWindow(), then look up, if its classname is "CabinetWClass" or "ExploreWClass", witch are the explorer window-classes. ok, so far, so good. then i subclass the "SysListView32" if it exists by passing through the CWnd-childwindows with EnumChildWindows(..., ...) - fine, works! i subclass the resulting CListView of the explorer-window and subclass its CListCtrl - ok - i can get the index of the selected item with .GetSelectonMark(). all functions work like .GetSelectionCount() and so on... but the function .GetItemText(item, subitem) dosen´t work - also the .GetItem(&pItem) dosent return the filename of the selected file... so what??? anyone have an idea? what i try to do: i want to check out if specific files are selected in the windows-explorer-windows - if they are selected, i want to run a action... :confused: cheers, vertex_x
-
best way for using html-controls/templates in vc++6?hi! i would like to implement a html-site - a small html-template with a few controls like a slider, buttons and so on... the user should be able to change the look of the application by just editing the html-template. from within c++ i want to get info, if the user clicks a control (button, slider...) and i want to change eg. the position o f a slider, content of a listbox, text of a button... the template has to be embeded in the main application... the main-framework should be a CDialog is it possible to do this without requesting the user to install ie6 or something? the app should also work, if just a minimum iexplorer is installed. or is there a way to do this without ie? how do i interact with the html-template from within my c++-code? has anyone a idea or tutorial? maybe some demo-classes on thecodeproject.com? i actually don´t know, what i have to search for ;o) cheers, vertex_X
-
instant messanger like icq over proxyyes, found that too, but it can only receive information over proxy. but it can´t start a listening socket (a server). im still wondering how icq makes that possible?! i could connect to a script on an http-server and check every second, if new messages arrive - but if more than 10 users check every sec. for new msgs: :zzz: X| - wouldn´t be a real instant messanger... hm... but thank you anyway... :o(
-
instant messanger like icq over proxythe point is, that my client/server app has to listen, if any connection comes in from the inet. but if there is a message sent from outside my lan, the message is sent to the ip of my dailup-pc. he does not know, that a client pc on the lan is waiting for the message...
-
need urgent help!im not very experienced in add in´s - would FindWindow() or FindWindowEx() help?
-
Where can i get specification for GDI+ images encoders/decoders?look for the CxImage-Library - found on sourceforge.net - i think its here on codeproject too! realy nice code, load/save all graphic-formats you need. i hope thats what you asked for ;o)
-
instant messanger like icq over proxyhi! i use one pc to connect to the internet. all other pcs connect over a proxy (janaserver) to the internet-pc to get into the inet. i try to code an small instant messanger like icq for my business. localy everything works fine! but how do i connect from my app to the internet over the proxy? it only works (of course) if i run the messanger-app on my server... i use 2 CAsyncSockets - one for sending, one for listening. i actually use port 80 for send/listen (its easyer to handle while developement). anyone has an idea? sorry for my bad english. not my native language. cheers, vertex