LCF-AT Posted March 22, 2017 Share Posted March 22, 2017 Hi guys, short question.Does anyone know where I can find / download a API reference file for msvcrt (C++) APIs?So at the moment I try to work with strings and find a lot APIs I can use and want to test them out how they work etc but I would also have any reference file for this too like the Win32 Programmers Reference help file where are listet many APIs I can check quickly.Dont wanna check every API on internet now to find the descriptions of them etc you know.Maybe you know something like this I could download and use. Thank you Link to comment Share on other sites More sharing options...
atom0s Posted March 22, 2017 Share Posted March 22, 2017 You can download and install the MSDN help information through Visual Studio as seen here: https://blogs.msdn.microsoft.com/pakistan/2013/02/04/download-all-msdn-documentations-for-offline-access/ 1 Link to comment Share on other sites More sharing options...
LCF-AT Posted March 22, 2017 Author Share Posted March 22, 2017 Hi, thanks for your answer but I dont want to install any 700 MB etc if I only need any C++ reference.Is there not anything else?Small & tiny like W32 hlp file? greetz Link to comment Share on other sites More sharing options...
Kurapica Posted March 23, 2017 Share Posted March 23, 2017 I had the old win32 reference in chm format but it is almost obsolete in 2017. before diving into the C++ APIs, I recommend having a good base to build on later by understanding the basic concepts, check this website : https://www.tutorialspoint.com/cplusplus/index.htm 2 Link to comment Share on other sites More sharing options...
Extreme Coders Posted March 23, 2017 Share Posted March 23, 2017 For pure C++ reference, you can try. DevDocs & Zeal documentation browser. Both provide offline access. For Devdocs, all you need is a web browser and the files get installed in your local storage which you can browse offline later. For zeal, you would need to install their help browser and a portable version is available as well. Later you can install the C++ docset for offline browsing. https://zealdocs.org/ http://devdocs.io/ 3 Link to comment Share on other sites More sharing options...
LCF-AT Posted March 23, 2017 Author Share Posted March 23, 2017 Hi again, thanks for the links Extreme Coders. So this was what I am looking for.I downloaded the portable Zeal app and did download the C++ doc.Seems to be a very cool app to download a lot of references docs.Just great.Why I didnt heard before about this nice tool? So I have some tiny questions about some strings. - Is there a API I can use like strstr but without case sensitive style?Similar like lstrcmpi just with checking the entire string text you know.Normaly if I search some string in a text I use strstr but its using case sensitive.Also I want to prevent to change the text to low char before I search something into etc. - Also I am looking for a API what can modify the text.... Example: Lets say I have this text.. 1 2 3 4 5 6 7 8 A 0 1 2 3 4 5 6 7 8 a 0 1 2 3 4 5 6 7 8 A 0 1 2 3 4 5 6 7 8 a 0 Now I want to search for all A / a text parts and to repleace them with my text like ABC and then it should look so 1 2 3 4 5 6 7 8 ABC 0 1 2 3 4 5 6 7 8 ABC 0 1 2 3 4 5 6 7 8 ABC 0 1 2 3 4 5 6 7 8 ABC 0 ...is there also any API what can do this for me?Something like a repleace function in Notepad.The API should then retrun a new pointer to created / modded text etc. greetz 1 Link to comment Share on other sites More sharing options...
Alzri2 Posted March 23, 2017 Share Posted March 23, 2017 LCF, You can do it easily if you're using a string type "replace" http://www.cplusplus.com/reference/string/string/replace/ You can achieve more complexed string manipulation/parsing/searching with regex (regular expressions) 1 Link to comment Share on other sites More sharing options...
LCF-AT Posted March 23, 2017 Author Share Posted March 23, 2017 Hi Alzri2, thanks but its not a function I can use.So I only can use API functions. PS: One question about the Zeal tool and the docs I can download.So I see there are not all listet in the tool like on the homepage.So I wanted also to download the HTTP doc but its not inside the tool. greetz Link to comment Share on other sites More sharing options...
atom0s Posted March 23, 2017 Share Posted March 23, 2017 If you are using CRT and STL stuff, look into std::string object. You can find various examples of replacements online, such as: http://stackoverflow.com/a/29752943/1080150 http://stackoverflow.com/questions/5343190/how-do-i-replace-all-instances-of-a-string-with-another-string 1 Link to comment Share on other sites More sharing options...
CodeExplorer Posted March 24, 2017 Share Posted March 24, 2017 Some examples here:http://stackoverflow.com/questions/3152241/case-insensitive-stdstring-findhttps://www.safaribooksonline.com/library/view/c-cookbook/0596007612/ch04s15.html Maybe will help you! 1 Link to comment Share on other sites More sharing options...
LCF-AT Posted March 24, 2017 Author Share Posted March 24, 2017 Hi again, thanks so far but as I said I was looking for any API what could do the parts but it seems there isnt any API I could use and need to handle it by myself.Also bad that there isnt a strstr API for cmpi style.Also here I only can handle it manually with detours like changing the string & text to upper or lower case etc. Its funny to see that there are a lot APIs but not for this. greetz Link to comment Share on other sites More sharing options...
fearless Posted March 24, 2017 Share Posted March 24, 2017 Could use the masm32 library and use the functions in that to search and replace and output to a new buffer. Typically i would use lowercase or uppercase on the string (if its small) to get round the case sensitivity if required, and if you require it to be non destructive, just make a copy of the buffer/string to perform the lower/upper case change on. For larger buffers/files then id opt for manually parsing the buffer/file and handling all the search/compare and copying in a loop. 1 Link to comment Share on other sites More sharing options...
Techlord Posted March 24, 2017 Share Posted March 24, 2017 On Thursday, 23 March, 2017 at 2:55 AM, Extreme Coders said: For pure C++ reference, you can try. DevDocs & Zeal documentation browser. Both provide offline access. For Devdocs, all you need is a web browser and the files get installed in your local storage which you can browse offline later. For zeal, you would need to install their help browser and a portable version is available as well. Later you can install the C++ docset for offline browsing. https://zealdocs.org/ http://devdocs.io/ This is one of the best offline reference tool that I came across. Thank you for sharing @Extreme Coders ! And do share any more such similar content that would be helpful to us when you have time Link to comment Share on other sites More sharing options...
atom0s Posted March 25, 2017 Share Posted March 25, 2017 On 3/24/2017 at 8:32 AM, LCF-AT said: Hi again, thanks so far but as I said I was looking for any API what could do the parts but it seems there isnt any API I could use and need to handle it by myself.Also bad that there isnt a strstr API for cmpi style.Also here I only can handle it manually with detours like changing the string & text to upper or lower case etc. Its funny to see that there are a lot APIs but not for this. greetz The API works fine, you have to use things together and code the in-betweens yourself. Everything people linked in this thread does what you want. I'm not sure what part you think doesn't work or fails to do what you are looking for. Link to comment Share on other sites More sharing options...
LCF-AT Posted March 25, 2017 Author Share Posted March 25, 2017 Hi, which API works?Thats why I am asking just about APIs without coding some stuff between.First the strstr API which only supports original exact strings to find something in a text.So I dont wanna upper or lower the text if it has 1000 bytes or more and strcmpi only checks from the pointer.In this case I have to upper or lower the text & my string in any buffer first to check whether the string is to find in the text or not.I thought there is any API which could do this already but seems there isnt such a API and now I have to handle it manually. greetz Link to comment Share on other sites More sharing options...
atom0s Posted March 25, 2017 Share Posted March 25, 2017 Again, I recommend you look into std::string then. With newer C++11 / C++14 / C++17 features you can take advantage of the object in a much better manner than just using the lower end API's. You can combine std::search with std::string to create your own ignore case searching function, and extend it into replacements as well. Link to comment Share on other sites More sharing options...
LCF-AT Posted March 26, 2017 Author Share Posted March 26, 2017 Also again,I dont code in C++ and was just looking for any ready dll function to do the steps I was looking for without to code extra stuff by myself you know.Thats all.If there isnt any API then its just ok to say it and all is clear and then I know it and have code a detour to handle it manually. greetz Link to comment Share on other sites More sharing options...
LCF-AT Posted March 29, 2017 Author Share Posted March 29, 2017 Hi again, new question.Is there any API like msvcrt.__getmainargs (I can use for commandline tools) I can use for not commandline tools?I mean lets say I create a edit control and I do enter any Arguments into (-r "test1" -x "test2" -u "test3") and now I would get them also spiltet back like it does for commandline.Also possible with any API? greetz Link to comment Share on other sites More sharing options...
ragdog Posted March 30, 2017 Share Posted March 30, 2017 Parsing the commandline Link to comment Share on other sites More sharing options...
evlncrn8 Posted March 30, 2017 Share Posted March 30, 2017 CommandLineToArgvW Link to comment Share on other sites More sharing options...
LCF-AT Posted March 30, 2017 Author Share Posted March 30, 2017 Hi, ok CommandLineToArgvW sounds good but I why isnt there no ASCII version to use?So I dont use Unicode strings.In this case I need to change my ASCII line to Unicode then using CommandLineToArgvW and then changing all splitet arguments back to ASCII.Ähhhh!Whats this again for a stupid BS?The getmainargs API does retrun all in ASCII too back. greetz Link to comment Share on other sites More sharing options...
Alzri2 Posted March 30, 2017 Share Posted March 30, 2017 Dealing with Unicode at first time requires patience... but before read everything about them: The Complete Guide to C++ Strings, Part I - Win32 Character Encodings The Complete Guide to C++ Strings, Part II - String Wrapper Classes What are TCHAR, WCHAR, LPSTR, LPWSTR, LPCTSTR (etc.)? WinAPI: Being Unicode Friendly Link to comment Share on other sites More sharing options...
LCF-AT Posted March 30, 2017 Author Share Posted March 30, 2017 Hi again, thanks for the links but I was only looking for any quick usable API and thats all.The getmainargs only works with commandlines and CommandLineToArgvW just works with Unicode strings.All in all I have again to write a detour and code something by myself again.So this is really disappointing. greetz Link to comment Share on other sites More sharing options...
atom0s Posted March 31, 2017 Share Posted March 31, 2017 6 hours ago, LCF-AT said: Hi again, thanks for the links but I was only looking for any quick usable API and thats all.The getmainargs only works with commandlines and CommandLineToArgvW just works with Unicode strings.All in all I have again to write a detour and code something by myself again.So this is really disappointing. greetz It takes 1 API to convert an ANSI string to Unicode, and 1 to convert back. Or you can use std::string and std::wstring to do it with its overload constructor. Not everything in C/C++ is just done for you. If you want stuff like that, I would suggest coding in a language like C# or Vb.NET or start using the vast amount of libraries and headers that are available for C/C++ such as Boost or similar. Link to comment Share on other sites More sharing options...
evlncrn8 Posted March 31, 2017 Share Posted March 31, 2017 (edited) and dont forget, at its core windows is unicode based.. not ansi.. and a 'detour' you mean a hook cos thats the terminology or do you mean a stub ?.. and its not that hard.. if you want it ansi.. getcommandlinea and parse it yourself, its the only options and the thing about the languages is right, i was an asm purist before and i really changed my mind, esp now as you have to consider multi platform and also x86 and x64 compilations, going all asm for it isnt worth the time, or the effort.. Edited March 31, 2017 by evlncrn8 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now