|
Quote: I don't know what to do anymore. Help me
Use the debugger to check what part of your code match your expectations and which part don't, it will help you to marrow the search of defects.
When you don't understand what your code is doing or why it does what it does, the answer is debugger.
Use the debugger to see what your code is doing. Just set a breakpoint and see your code performing, the debugger allow you to execute lines 1 by 1 and to inspect variables as it execute, it is an incredible learning tool.
Debugger - Wikipedia, the free encyclopedia[^]
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]
The debugger is here to show you what your code is doing and your task is to compare with what it should do.
There is no magic in the debugger, it don't find bugs, it just help you to. When the code don't do what is expected, you are close to a bug.
Here is links to references books on C and C++ by the authors of the languages. Note than C is the ancestor of C++, so knowing C is always useful with C++.
The C Programming Language - Wikipedia, the free encyclopedia[^]
https://hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2.pdf[^]
http://www.ime.usp.br/~pf/Kernighan-Ritchie/C-Programming-Ebook.pdf[^]
C++ Programing Language[^]
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
my english is poor ,so I want to help you ,but I can't tell you in english. we can learn together.
|
|
|
|
|
Hi Friends,
I am using VS2015 and having a solution having 33 VC++ projects. I am using Klocwork insight 11.0 for code analysis work.
while running it, its getting stuck on any of the file. I tried re-installing Klocwork and restarting visual studio as well.
Please help me out if anyone have any idea.
Regards,
Amrit
|
|
|
|
|
|
Hello everybody,
I don't know if I omits something or if I've not correctly understanded something, but I've an Strange exception.
This is the code who generates the exception :
<br />
NetTcpBinding^ binding = gcnew NetTcpBinding();<br />
binding->Name = "IMyWebService";<br />
EndpointAddress^ address = gcnew EndpointAddress("myUrl");<br />
<ChannelFactory<IMyWebService^>^> factory = gcnew ChannelFactory<IMyWebService^>(binding, address);<br />
Exception System.ArgumentNullException occurs on last line.
"All parameter names used in operations that constitute a service contract must be not null. Parameter name : name"
Have you any idea why I'm receiving this exception ?
Many thanks for your help
Best regards,
Syncerely yours,
|
|
|
|
|
You need to use the debugger to examine both of the new objects and see exactly which property is causing the exception.
|
|
|
|
|
Hi,
Thanks for your reply.
Of course. Objects have been examined but no null name parameter was found.
I've tested using configuration file on the Web service to define the service, behavior, ... rather than using code only.
But same error.
Debugger was checked on both side (client / service).
Very strange.
Regards,
Syncerely yours,
|
|
|
|
|
The error message is quite clear, so there must be a null parameter somewhere. It may well be inside the actual framework, caused by something not being built correctl. And the only way to find it is by going deep in the debugger.
|
|
|
|
|
How do I increase size of my tooltip control as I need to show image to my tooltip I probably need to increase size of my tooltip control?
I tried using Text Renderer Measure Text but it just for increasing size according to text we provide.I want to increase size means height and width of my tool Tip so that my whole image gets displayed. Right now only part of image getting displayed using graphics Draw Image function according default size of tool Tip which is small.I am also providing default size of my image by using Graphics Draw Image function.But since size of my toolTip is small only part of image getting displayed.
|
|
|
|
|
|
Thanks.But actually i wanted to modify my toolTip means increase height or width without using HANDLE.Also i tried to create Rectangle using DrawImage function but didnt worked.
|
|
|
|
|
Why not just use a method that works?
|
|
|
|
|
can we use # sign at places other than with the header files
|
|
|
|
|
Yes, you should have #include in your cpp as well. Other uses are the various #pragma s, #define , and is a part of preprocessor operators[^]
Header files are simply to separate definition from implementation generally speaking. They aren't anything special as far as the language itself is concerned.
EDIT: And preprocessor directives[^] in general, just to clarify.
modified 22-Dec-16 12:12pm.
|
|
|
|
|
|
void CreateFolderPath(string Path)
{
char *strFolderPath = new char[Path.size() + 1];
strcpy_s(strFolderPath, Path.size() + 1, Path.c_str());
_mkdir(strFolderPath);
}
string ConvertIntToString(int cipher, int objintiger)
{
string temp;
char *Res = new char[cipher];
sprintf_s(Res, cipher, "%02d", objintiger);
temp = Res;
return temp;
}
//
Is there room for memory problems?
|
|
|
|
|
There are problems (memory leaks). You must delete memory allocated with new when not used anymore:
void CreateFolderPath(string Path)
{
char *strFolderPath = new char[Path.size() + 1];
strcpy_s(strFolderPath, Path.size() + 1, Path.c_str());
_mkdir(strFolderPath);
delete [] strFolderPath;
}
string ConvertIntToString(int cipher, int objintiger)
{
string temp;
char *Res = new char[cipher];
sprintf_s(Res, cipher, "%02d", objintiger);
temp = Res;
delete [] Res;
return temp;
}
For your first example there is even no need to copy the string. Just pass it to _mkdir() :
void CreateFolderPath(string Path)
{
_mkdir(Path.c_str());
}
|
|
|
|
|
Thank you very much!!!!
|
|
|
|
|
hi friends:
why c++ is still being used?!
|
|
|
|
|
Why shouldn't it be used anymore?
Your question is like asking why there are people still driving a Ford.
|
|
|
|
|
|
..because you can't program an OS in VB.NET.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: can't program an OS in VB.NET. You can't do that in C++ either, if you can then you can do so in JavaScript too.
Or even Python.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Afzaal Ahmad Zeeshan wrote: You can't do that in C++ either, if you can then you can do so in JavaScript too. Well, it is also not completely true.
Most parts of the modern OSes is made in C and C++. You don't write drivers in JavaScript, because most devices work faster than your average garbage collector. It at least needs a language that can compile to native, without dependencies.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Quote: Well, it is also not completely true. Because it was not meant to be. It was merely a rant, or joke.
Quote: Most parts of the modern OSes is made in C and C++ Most part comes from C, that contains Assembly in __asm or similar. C++ is just used to create most APIs, because you can provide a simple abstraction there. You can provide underlying implementation of the system and services, then you leave it in the hands of programmers.
Of course drivers need to be fast, but what a driver is merely a program in the forest of services running. Tree (program) can be a class, a forest is abstraction, and... You cannot do that easily in C — that is why we have demons in Linux and you can write in in any definition, there is nothing to implement, nothing to inherit and nothing to worry about.
Move a bit ahead, enter the realm of C++, Qt for instance, you need to write classes as inherited ones and then you can compile that across. Qt is used for driver development.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|