Your partly correct, indeed it indicates that C++ name mangling should not be used. But this does not mean plain function names. It's mangling the way c get's mangled. For example a function returning a 32 bit int would be something like function@4 and if u take stdcall c function by a microsoft vc compiler u often get even more mangling on the function name.
Mark Kruger
Posts
-
Speaking of C++ -
Excellent quotesBack in the Windows 95 age i had a program which throwed a random message from it's messagelist each day. A few nice ones i still remember: 2B or not 2B, that's FF. On an empty disk u can seek forever. Press once to quit, twice to save. Besides this i always loved DeeDee (from Dexter's laboratory), "Dexter, what does this buttton doooo?" (Asking while trying) And last but not least comming from a programmers book, don't recall which. "There's no program on earth without a bug." <- Explaining that environmentissues can always let a program misbehave.
-
CodeProject TV XBMC PluginWas exactly my thought, 1 of the things which make XBMC so portable is that it mostly uses python, which is supported well by many platforms, including where i'm running under myself, lubuntu (iow xbmcubuntu)
-
CodeProject TV XBMC PluginThat's exactly why i made the reachout, i think am able to determine each ruleset/logic we need thou am not able to reshape that into python, well not in a short notice at least, i would have need to learn the language 1st, and how to debug it nicely. I.o.w. i seek someone who can take the lead in the programming itself, which i can support into with how u can get each thing at where it needs to be, the html, php, javascript interpretation and what to do with it is what i can offer.
-
CodeProject TV XBMC PluginI just noticed the great new functionality of codeproject tv, i believe it would be tremendously nice to be able to watch courses on how to apply certain techniques on your couch using your mediacenter based on xbmc. Though i'm myself a win32 programmer skilled in C++, VB but not in Python. IOW would someone be interested into building a plugin for XBMC to be able to view CodeProject TV?
-
Do you wear out your keyboards?I don't wear them dead, am at mine 3rd i guess now, could be fourth, replaced cause of color and the other to move to ps2, my old big plug didn't fit any longer. Though my latest, my logitech keyboard is about i guess 5 years old, half the keys don't have letters on them any longer, but it still functions fine.
-
Do u find c# descent?A clear view i understand and agree with, thank you :) Cause of the reactions yesterday ended up writing a field reader writer (including basetypes), which works on arrays and icollection(generic only) as well (and specially in those occations to make of copy of each cell) recursivly with an object array[,] to be able to detect when items and pointing to somethin' processed before in that case i place the copied variant on the spot. Implemented all real valuetypes (iow int, long, decimal, string) by individually copy lines to make sure those go well. Called my function GetDeadCopy and returns a boolean now whether it had succes or not. Have not implemented a field checker yet for combi with collection to see what's touched. But the total function does already a lot more then were i wrote the thing for. Being more easily able to use data packages in dictionaries and lists without having the need to give each package an own copy constructor (or clone however you want to name it). Anyways thanx for the responds and the reason for me to look a bit deeper.
-
Do u find c# descent?Exactly ;) But still u know often when u just have enough with a shallow copy, cause u created the class/structure etc u need an not original reference instance from. And that's exactly where i made the function for. Just to let me not dumb re-re-re-re enter the same line of code over and over again, nor gives me need to inherit a base class which makes it public
-
Do u find c# descent?The function written in my question was a 3 minute wrap, not yet formatted for my real program (which as i normally do tries to escape most errors by testing on validity before i make the call, besides that likely i'll introduce a boolean on return and the return value as an out variable) But that about the function. Does memberwiseclone does something different then copying fields bitwise and referenced objects by reference ? And for the things i apply them are structures/classes which are only ment for data storage (iow abusing dictionaries for speedy retrieval of my mini in memory database like environment) i think that's more then enough. Though if it can cause unwanted results it's handy to know that. But ain't that the same for createhandle and destroyhandle of a nativewindow etc. U need to know how to handle them and normally that would be by a good documentation of the function for everyone to read, which likely is present for memberwiseclone as well.
-
Do u find c# descent?What i mean, i keep finding out spots in c# where i think, microsoft but why. For example the ICollection-generic interface which has been derived van IEnumerable and IEnumerable-generic which let u implement the same named function only with a different return type and u think like, that can't be so how can i not implement icollection and list, dictionary etc while microsoft can. Why is it that i need to cast a dictionary to ICollection-KeyValuePair first before i can call the dictionary's CopyTo method to get it's whole list and not just values or keys. Or for instance when u work with an dictionary the way i do in my latest program for my work i want copies of the retrieval cause i need to detect chances against the dictionary. I Used to make a getcopy function where i would pass the object and would return a new instance filled with the data from the other. Then when i was playing around a bit u find out that object has MemberwiseClone only u can't access it normally. I ended up writing the next for something which is present on each object (should need less flags, wasn't in the mood to find out which i could skip)
private const System.Reflection.BindingFlags FullAccess = System.Reflection.BindingFlags.CreateInstance | System.Reflection.BindingFlags.GetField | System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.SetField | System.Reflection.BindingFlags.SetProperty | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic; public static T GetMemberWiseClone(T ToClone) { T Result = default(T); if (ToClone != null) { try { Result = (T)ToClone.GetType().GetMethod("MemberwiseClo
-
Gotoless programmingExcept that then u might want to retrieve the current size each loop what does it make it different for the rest? I see no different(new) reason to agree break is a good way to be honest.
-
Gotoless programmingIf u want speed, i would const the size of for your fixed string, would safe u getting it's length each time u go for another loop in the while. The continues u fire are at end of each if slice, and in an if else construction it would jump out to bottom anyways, so in this case i think continue actually will be equally fast at best and else even slower.
for(unsigned int i = 0; i < StringArray.size(); ++i)
{
if(!stricmp(text+sizeof("other thing ")-1, StringArray[i]))
{
StringArray.erase(i);
break; // or use goto JumpHere?
}
}I normally do different, a bit slower i assume but clear
//somewhere outside the while
const int Sizer = sizeof("other thing ")-1;
//int WalkTo = StringArray.size() - 1;
if (WalkTo >= 0)
{
const char* Check = text + Sizer;
int i = -1;
int Found = 0;do { i++; if (!stricmp(Check, StringArray\[i\])) { StringArray.erase(i); Found = 1; } } while (!Found && (i < WalkTo));
}
-
Gotoless programmingGood example exactly of not using goto at all, it's easily converted to an if then else situation. which increases readability if u would ask me.
while(settext())
{
// Command 1 (no parameters)
if(!stricmp(text, "something"))
{
DoStuff();
// continue; // Skip command 2-3 & error check
}// Command 2 (single parameter - text to match)
else if(!strincmp(text, sizeof("other thing ")-1, "other thing "))
{
for(unsigned int i = 0; i < StringArray.size(); ++i)
{
if(!stricmp(text+sizeof("other thing ")-1, StringArray[i]))
{
StringArray.erase(i);
break; // or use goto JumpHere?
}
}// Did not find? You have to use a variable to check ReportError("parameter not found");
// continue; // Skip command 3 & error check
}// Command 3 (not set up)
else if(!stricmp(text, "asparagus"))
{
// continue; // Skip error check
}
else{
// Error check
ReportError("command not found");
// JumpHere:
// continue; // Labels must have a statement
}
}