|
Yeah I saw that before and rolled my eyes
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
ldsdbomber wrote: is C# and .NET taking over?
taking over what?
ldsdbomber wrote: nor do I really need any cryptic replies like "use what you feel most comfortable with"
Yeah that would be wrong anyway. Languages and IDEs are tools. Not every problem is a nail therefore not every solution is a hammer. Hopefully that doesn't sound cryptic to you. While the field of software you work in may not narrow things down to a single answer it might tend to point towards a smaller list. You have not provided us with that information.
led mike
|
|
|
|
|
Well I thought I had provided you with that information. I'm not writing full scale projects, mainly dialog based apps for my own amusement, but with a view at some point to also writing similar tools and utilities for work. As I've not really been "in" the field for a while, now was a good time to get an update as to whether that kind of thing is better done now in the new technology or not
|
|
|
|
|
ldsdbomber wrote: Well I thought I had provided you with that information.
ldsdbomber wrote: at some point to also writing similar tools and utilities for work.
Well I'm not sure how to respond to that. There is a significant difference in the type of software you need to develop if your "work" is in a company that makes robotics or missile guidance systems as opposed to a company the sells books from a web site. These are types of things that might make a significant difference in language and tool choices.
"Once you've heard the truth everything else is just cheap whiskey"
Sheriff Buck Olmstead - the movie Switchback
|
|
|
|
|
I understand that, but probably if it was that serious I'd mention it The fact that it is "simple dialog apps" is a bit of a clue though, it's generally data analysis type things base on the MFC dialog app wizard - so, no, nothing fancy, though on occasion it's data that will be used in a clinical situation so accuracy is sometimes very important in terms of calculations and data flow.
|
|
|
|
|
Based on the information provided I see nothing there that indicates that using .NET and C# would be detrimental. The combination of the language and IDE make it probably the most Rapid RAD combination today. So since you don't appear to have any special considerations that might cause any barriers I would likely choose C# if I were in your shoes.
Also keep in mind that even if you find you have some calculation performance issues, which is unlikely, you can develop a C++/CLI assembly in mixed mode so you can do large calculations in native C++ or even assembler and provide a .NET class as the interface so it can easily be consumed by your C# project.
led mike
|
|
|
|
|
The auto conversion does not help.. And i have many errors.
Help...
limitless
|
|
|
|
|
I recommend that you post a resonable cross section of those errors or any replies you do get will just be speculation and speculation on your capabilities is probably just as likely as speculation on your problem.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Pick one error that happens a lot, check MSDN or google to see if it's a new "feature" of VS2008.
if it's a new "feature", you can probably define something to override it.
other than that, pick one error and fix it, go to next error and repeat.
|
|
|
|
|
limitless wrote: And i have many errors.
For instance...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
I need help on just re-writing this function I created to something else that also functions the same for a friend of mine to use. Here is the function code:
*These are just input parameters
NoErrors is a Bool: passed by reference
amp is an int: passed by reference
string g[]: an array
string key: just a string
void Check(string g[], int& i, bool& NoErrors, string key)
{
while(g[i].length()!=4) //Checks to see if it is 4 letters
{
g[i]="";
cout << "Please enter 4 colors!" << endl << endl;
cin >> g[i];
}
NoErrors = IsStringLike(g[i], "RGBCMYrgbcmy"); //Checks for right input
// The IsStringLike is a function I also have but that does not need to be changed
// If checks to see if the string is like the characters in "RGBCMYrgbcmy"
while(NoErrors == false && g[i]!="Fred")
{
g[i]="";
cout << "Please enter appropriate colors!" << endl << endl;
cin >> g[i];
NoErrors = IsStringLike(g[i], "RGBCMYrgbcmy");
}
//Fred Cheat - allows user to display the code before the game is over
if (g[i] == "Fred")
{
cout << key << endl << endl;
g[i]="";
cin >> g[i];
while(g[i].length()!=4) //Checks to see if it is 4 letters
{
cout << "Please enter 4 colors!" << endl << endl;
cin >> g[i];
}
NoErrors = IsStringLike(g[i], "RGBCMYrgbcmy"); //Checks for right input
while(NoErrors == false && g[i]!="Fred")
{
cout << "Please enter appropriate colors!" << endl << endl;
cin >> g[i];
NoErrors = IsStringLike(g[i], "RGBCMYrgbcmy");
}
}
} // End of function
This function is an error checking function and it checks for valid input in a game I'm creating. I hope that the comments in the code are suffice for you to understand what that particular part does. I just need to somehow alter this code and make sure it still does its basic function but written different. It's a little hard to alter something and make it work the same as the initial function. Please email me if you have any questions. Thanks for your time! I hope you can help.
|
|
|
|
|
Larry Park wrote: I just need to somehow alter this code
Alter it into what?
led mike
|
|
|
|
|
Rewrite it by yourself.
Follow these:
use vector instead of array.
<br />
void Check(vector<string> g, int& i,string key)<br />
{<br />
}<br />
btw, I dont understand a point here. If you already know the index, And if you are not making use of it like an offset, like i+n,i+n*2 and simply using [i], why do you send both index and the array to a separate function?
eg:
int nCheckItem = 3;
std::vector<std::string> vec_stCol;
//Assume you have 5 elements inside vec_stCol. You can make the checking function like :
<br />
if(check(vec_stCol[i],"mykey"))<br />
{<br />
. <br />
.<br />
}<br />
<br />
bool check(const string& stToBeCompared,const string& stCompareKey);<br />
<br />
use stToBecompared.Find() to check if the stToBeCompared string contains stComparekey in it.
Rest of the part, it's same, make use of find() algo.
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
modified on Thursday, March 13, 2008 1:45 PM
|
|
|
|
|
Larry Park wrote: ...but written different.
French? RPN? Sans STL? If you wrote it, why can't you rewrite it? Please explain what the problem is.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Ok have to admit, for a potentially needy person your reply is more clearer than mine.
led mike
|
|
|
|
|
Geez, it's a friend - just give him the working function as-is!
I mean, he posted the code on a public message board - the new technology
has already been leaked
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: the new technology
has already been leaked
LMAO I am extremely grateful I did not have a mouth full of coffee when I read that email. Timing is priceless, for everything else there's mastercard.
led mike
|
|
|
|
|
I used it as a image/bitmap in a memory Graphics object.
When client resizes, it should be resized too.
Now I construct a new one every time, any effecient way by GDI+ ?
|
|
|
|
|
Just use a mapping mode like MM_ISOTROPIC or MM_ANISOTROPIC.
output the bitmap in logical coordinates(window) and the device context will automagically transform it to client coordinates(viewport).
It works pretty nice assuming you set everything up correctly.
|
|
|
|
|
followait wrote: When client resizes, it should be resized too.
just find the scale factor
when drawing the image use Matrix::Scale and Graphics::SetTransform or Graphics::ScaleTransform with the scale factor and draw the image.
followait wrote: Now I construct a new one every time
No need to construct every time client resizes.
|
|
|
|
|
There's also Graphics::DrawImage() methods that will stretch the image.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Although you can display a GDI+ Bitmap object at various sizes, the Bitmap class does not allow you to change the actual size of the Bitmap object itself. You do have to construct a new one.
Another note: you may be using a Graphics object in memory, but whenever you use a Graphics object based on a window, you have to construct a new Graphics object each time the window is resized.
|
|
|
|
|
Hi, I'm trying to add a custom header for every HTTP request of a IWebBrowser2 instance.
I known that the param Headers of the method IWebBrowser2::Navigate2 allows me to add custom headers but the problem is that it's valid only for the main request and it's not "propagated" for all the related requests of resources (for example).How can I hook every request and alter the headers?
Plz help!
|
|
|
|
|
berserker_r wrote: How can I hook every request and alter the headers?
DWebBrowserEvents2::BeforeNavigate2[^]
May be this is the hook you are looking for. Defining the event handler is implemented for CHtmlView in MFC source, have look at it or use CHtmlView and get the callback CHtmlView::OnBeforeNavigate2().
you can modify and reissue the request
|
|
|
|