15,892,072 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Pascal-78 (Top 75 by date)
Pascal-78
6-Dec-19 9:54am
View
Deleted
According to the data, the output is correct. The array with the number of items per sections gives a total number of 6 (1+2+3). May be the number of sections is incorrect
Pascal-78
17-Apr-18 11:52am
View
The time difference is a pointer difference! It will not give the right time.
Your code displays the start time twice!, and it displays the milliseconds without the seconds.
For time arithmetics, you should convert your SYSTEMTIME to FILETIME then to ULARGE_INTEGER and do arithmetics using the last type.
You should start by getting a good time measurement first
Pascal-78
18-Aug-17 5:50am
View
Did you try the LockWindowUpdate method to avoid window-flashing? It may also speed-up a little (because insertion of new item in the list will not start a new redraw).
Pascal-78
22-Jul-16 5:32am
View
Like Richard said, without code it is just a guess:
I assume the 3 classes are in the same project, if yes, it is not a missing reference problem. What is the declaration of the static method? Is it private, public, protected, or internal ? without any specification it is private and not accessible outside the class itself. Use internal or public to allow access from outside the class.
Pascal-78
19-Nov-15 11:55am
View
I do not see any VARIANT in your code. RequestDataVal seems to be a managed object. Can you provide the GetRequestData prototype (or the source code if it is a wrapper you have done for the dll).
Pascal-78
18-Nov-15 12:00pm
View
Since Windows Vista, some operation needs "Elevated Privileges" even if done by the administrator account. Those operations usualy display a message asking for allowing the program to make changes to the system.
To check this, you may use the runas command to start a new cmd.exe with the new user Id and test if the copy is ok, and if not you can try to start a new cmd.exe with a right click and "run as administrator", it should prompt for a user with admin rights but it will also use elevated privileges... You may have more details by looking the UAC (User Account Control)
Pascal-78
11-Aug-15 11:13am
View
What did you try?
It's look like the C++ DLL is not unicode and LPCTSTR is same as LPCSTR (i.e. TCHAR is not wchar_t but char).
Pascal-78
11-Aug-15 5:27am
View
Reset the waitingTimer to true each time the user change the dateTimePicker1 value to reactivate the alarm.
Pascal-78
5-Aug-15 3:52am
View
This code should be applied inside your "MyData" class. but I cannot help more without information about this class.
Pascal-78
17-Jul-15 11:01am
View
Did you have Right-to-Left-Mark and Left-to-Right-Mark characters (U+200F and U+200E) inside your string to switch from LTR to RTL and RTL to LTR ?
Pascal-78
15-Jul-15 9:54am
View
Since you are in a class (you used "this"), you can add a new method and used it as a delegate.
But I do not understand why you try to "Invoke" that line of code instead of using it directly.
If "this" is a UserControl, you may require the Invoke call if you try to access some ControlProperties (like Visible, Text, ...).
But if it is for concurrent access of the ipaddr->second (which looks like a vector or a list), you should consider implementing the lock keyword in C++/CLI (see https://msdn.microsoft.com/en-us/library/sy1y3y1t.aspx)
Pascal-78
15-Jul-15 6:04am
View
Do you want to use Anonymous delegate (see https://msdn.microsoft.com/en-us/library/0yw3tz5k.aspx) ?
But anonymous methods are not available in C++/CLI.
Pascal-78
24-Jun-15 10:28am
View
Reason for my vote of 1 \n String Builder is useless
Pascal-78
27-Apr-15 3:39am
View
I tried ping with -t option for continuous test, and no packet is lost with ping but in the same time, my program still losing packets.
And if you use ping with -n 1000, you will have to wait 1000 seconds to get the result. ping makes request every second.
I'm quite sure the problem is not on the network but in the IP stack of Windows, or the Windows Filtering Platform, or in my program itself...
I found this program: https://iperf.fr/
and its results are similar to my program, sometime 88% of datagram loss, sometime 0%...
Pascal-78
24-Apr-15 15:24pm
View
The clients connect themself to the stream by registering to a multicast group (ip from 224.0.0.0 to 239.255.255.255). They all use the same multicast address, and the server send images to this multicast address.
When I'm using only 1 client, the client do not register to a multicast group, and the server send the images to the client ip address directly.
I have a real TCP/IP server running to configure the image sender from a client or to retrieve the multicast group from a new client.
Any help will be appreciate. I'm working on it for weeks now. It will be a good article if we successfully solve this problem.
Pascal-78
24-Apr-15 15:16pm
View
I check the link you gave, but since I made tests using direct-link, a lot of the tools are irrelevant. SpeedTest on a Local Area Network will be usefull but not over Internet...
Pascal-78
24-Apr-15 15:03pm
View
It's quite the idea,
but for sharing desktop to multiple users, we have found hardware solutions,
our cameras already have their multicast mode, but if we want to insert some image processing, we have to send a new image from PC to others or if we want to simulate a camera...
Pascal-78
24-Apr-15 14:39pm
View
The clients are polling their socket to check if new data are available.
When data are available, they retrieve them.
And yes, it looks like a server, but with your proposal, it quite similar:
- client send request to server using TCP
- client receive data from server using TCP
in my case, there is no request sent by client, and the client receives data from server using UDP.
You talk about minutes, I talk about millisecond. in fact, the server (the one providing the images) should send a new image every 22ms (approximately 45 img/s), each image is more than 2MB (and yes, that means more than 700Mb/s, but I use a 10Gb/s link between the PC.).
And the clients should do their job in realtime. I cannot delay one client...
Pascal-78
24-Apr-15 13:36pm
View
Multicast (http://en.wikipedia.org/wiki/Multicast) is a way to send data (in my case) from 1 PC to many others but not all.
Unicast: 1 to 1
Multicast: 1 to many, many to many
Broadcast: 1 to all.
My current test is made only with 2 PC (1 sender, 1 receiver) but the main goal of my project will use more receivers.
The advantage of Multicast from TCP: it used only 1 send for all the clients where TCP needs 1 send per client. In terms of bandwidth : Multicast does not change the needed bandwidth if the number of clients increase, but TCP will have to use N times the bandwidth for N clients.
This application is similar to an ip-camera sending images to clients, the clients do not ask for image, clients are listening on an opened port for the incoming stream.
Pascal-78
24-Apr-15 13:21pm
View
And how do you do "Multicast" with TCP ?
Pascal-78
1-Feb-15 8:40am
View
I put the files in the question.
Pascal-78
26-Jan-15 12:05pm
View
Deleted
If you mean that the user must acquire a license to use your dll, I think there are some other tools that may encapsulate a license management to your dll, or you need to do it by code inside your dll, for example by checking a encrypted key found in a file beside your dll or in a registry key.
Pascal-78
19-Jan-15 10:45am
View
An other potential problem: in some region the comma is used as thousand separator. may be the scanf function in your country will ignore the comma for an integer and will see the input as only 1 number.
Pascal-78
19-Jan-15 10:32am
View
The only error I can see in your code is what CPallini explained in its solution.
If you try to enter numbers without the comma between them, the "b" variable will not be initialized.
To check that, you can display the values of a and b with the result. Or debug your program step-by-step and watch the values of a and b after the scanf.
I tried "13 ,26" (a space exist between 13 and the comma) and in this case, b is not initialized (scanf failed !)
Pascal-78
19-Jan-15 8:49am
View
I think he wants the Greatest Common Divisor and not the lowest. but the "break" will be a good idea if the loop is backward (from a to 1).
Pascal-78
5-Aug-14 5:37am
View
UdpExemptPortRange doesn't work...
Pascal-78
5-Aug-14 2:54am
View
The bind did not fail.
sendto returned the number of bytes emitted.
But the packet did not reach any listener of the Multicast group (over the network) or on the same PC (the same program), and, of course, I already tried deactivating the firewall.
The same program works perfectly on other PC. The main difference is the Operating System : Windows 8.1 (Desktop) fails, Windows 7 (OK), Windows 7 in a VM in the Windows 8.1 (OK !).
Pascal-78
4-Aug-14 14:07pm
View
I do not run my program in a VM, Hyper-V is at the same level and add a network interface seen by the host to interact with one of the VM (Windows Phone Emulator) but no VM are activated.
This work-around does not apply to my problem.
My program can add membership to 224.1.2.3 Multicast address and receive datagram sent by other PC. But it cannot send any datagram to those other PC or itself using this multicast address.
Pascal-78
24-Jul-14 10:51am
View
Did you try specifying the CharSet in the DllImport attribute?
[DllImport(@"F:\bin\APIClient.dll", CharSet=CharSet.Ansi, ...)]
I never tried returning a string but for the arguments, I only defined the charset and the argument as string without [MarshalAs] attribute on each argument.
Pascal-78
5-Jun-14 12:13pm
View
Just what I have done: the program needs to call a new function before exit to cleanup the dll (the global object can be changed to an object initialized by a function and destroyed by the explicit cleanup function)
Pascal-78
5-Jun-14 11:47am
View
It seems I was wrong, the dynamically loaded DLL are unloaded before unloading the implicit dll
DllMain with ProcessDetach is called before I enter in my global object destructor.
Any exception in this state is resulting as a program termination without any warning (no cleanup at all !)
Pascal-78
5-Jun-14 11:25am
View
I guess it will work with the basic level of my question, but the real case is more difficult (I updated my question with more details)
Pascal-78
5-Jun-14 9:47am
View
I hoped that this flag already exist in the runtime. (I'm using Visual Studio 2010 as compiler)
Pascal-78
7-Feb-14 14:53pm
View
The OpenFileDialog window is displayed only when OpenFiles.ShowDialog() is called. If you do not have this line elsewhere in your code, that means your AttachFiles method is called.
You should debug your code, put a breakpoint on the ShowDialog line and then look at the call-stack to understand why it's repeating this.
Pascal-78
12-Dec-13 4:28am
View
Did you check that ProcessData method ends and the completedCallback method is called and ended?
May be you can add those 2 methods in your question.
Pascal-78
4-Dec-13 9:01am
View
In fact, "U+FFFD" is the specific code for "replacement character" used to replace an unknown or unrepresentable character. and "FF FF" is not allowed as an Unicode Character. May be it's an other mistake of the program generating the file.
Pascal-78
5-Nov-13 11:31am
View
The XML used in this version is not compatible with the file generated the first time. That means the first time the file cannot be deserialized to a list and a new list will be created.
Did you try to debug your program and look in the unserialized list?
Did you try to click on your save button twice?
By the way, this is not a solution, you should have used the "Have a Question or Comment?" button (like the way I added this comment.)
Pascal-78
23-Oct-13 4:34am
View
by click x, do you mean click on the close button of the window ?
In this case, the console program should be closed when the program finished.
If not, you may have an old option "Close on exit" not checked.
How do you start the LFNReport program? using start? using cmd? or directly the program?
I think you should use directly the program (without start or cmd).
Pascal-78
22-Oct-13 5:27am
View
You should put the path before the file name. I would recommend to store the path in a variable:
SET mydir=logfile\%date:~12,4%%date:~4,2%%date:~7,2%
mkdir %mydir%
copy response.txt %mydir%
copy LFNReport.Exe %mydir%
move permission_data.txt %mydir%
cd %mydir%
LFNReport.exe < response.txt
or %mydir%\LFNReport.exe < %mydir%\response.txt
Pascal-78
9-Aug-13 17:04pm
View
Why using 4 constructor, when 1 is enough?
_msize will give the size of the memory block as byte and it uses void* as argument type.
just allocate a new block of the same size and copy it.
MyClass::MyClass(void* Source)
{
__int64 size = _msize(Source);
InputBuff = _malloca(size);
if(InputBuff!=NULL)
memcpy_s(InputBuff, size, Source, size);
}
One more thing : returning from a constructor without initializing all the members is not a good idea, OutputBuff is never initialized and InputBuff is initialized only if memory is allocated.
Pascal-78
9-Aug-13 11:13am
View
Can you give more details on your error, I tried the full program (see in my solution) and I have what I expect.
Pascal-78
29-Jul-13 7:26am
View
I am happy you find the solution to integrate this in an XmlSerializer.
I have learned something too: Serializing a property of type XmlDocument will include it in the final XmlDocument.
You may include the code to generate the XmlDocument and to read from it directly in the get and set accessors
Pascal-78
29-Jul-13 5:13am
View
I have updated my solution with a "manually" created XmlDocument
Pascal-78
11-Jul-13 15:21pm
View
the union could be :
typedef union { int ivalue; char bvalues[4]; } theUnion;
theUnion v;
v.ivalue; // To Get or Set the int value
v.bvalues[0 to 3]; // To Get or Set the byte values
Pascal-78
11-Jul-13 15:15pm
View
You're right, to let the user enter the value, you just need to have the value variable declared as an int and use the instructions you mentioned :
int value;
cout << "Enter your value" << endl;
cin >> value;
Pascal-78
4-Jul-13 5:15am
View
To check if your function is called, you can insert a call to "OutputDebugString" and check if your string is displayed in the debug windows of VS (or in the dbmon output window).
You may also try to call InitCommonControlsEx first. (http://msdn.microsoft.com/en-us/library/bb775697%28v=vs.85%29.aspx)
Pascal-78
4-Jul-13 4:11am
View
Did you check with "Dependency Walker" (depends.exe) if your f function is exported.
You should specify __declspec(dllexport) on your f function in the C++ file to export it.
Pascal-78
25-Feb-13 9:51am
View
If the problem occurs after few minutes, you may have a resource problem. You should Dispose the old image of your PictureBox each time you change it.
Garbage Collector will free some object when the memory resource is low, but not when the GDI resource is low (Bitmaps are stored as GDI resources until you dispose them)
Pascal-78
8-Feb-13 14:58pm
View
I used this code to connect my android program to a server on my PC:
socket = new java.net.Socket();
InetAddress address = InetAddress.getByName("192.168.1.10");
socket.connect(new InetSocketAddress(address, 2012/*port*/), 5000/*timeout 5s*/);
help on this method can be found here:
http://developer.android.com/reference/java/net/Socket.html#connect(java.net.SocketAddress, int)
Pascal-78
8-Feb-13 11:43am
View
You create the server socket on port 2012 but try to connect the phone on port 2001.
On the phone: you should create a socket (without specifying address and port) then you can use the "connect" function (you will have access to a timeout parameter in this function).
When I made some socket test with my phone (using Android 4), I have to do 2 things:
- allowed full internet access (with eclipse and the android developer plugin, you have to edit the xml file describing the requirement of your app)
- use the socket function in a new thread:
new thread(new Runnable({ @Override void Run() { } })).start();
Pascal-78
22-Dec-12 12:48pm
View
After a search on the net, it seems this pragma is useless in debug-mode because overridden by a compiler option.
I tried modifying some compilers options and it seems that your problem can be solved with removing the /RTCs, /RTC1 (/RTCs + /RTCu) this option is available in "C/C++ - Code Generation" properties of your projet.
Pascal-78
19-Dec-12 11:34am
View
"naked" will remove a lot of thing, like
the possibility to use C++ object with potential thrown exception (error C3068)
the possibility to initialize a variable at declaration (int a=1;) (error C2489)
may be _forceinline is a better choice.
Pascal-78
13-Dec-12 12:03pm
View
I agree. He should try using student.txt files with some format error:
- Big string between 2 '$' signs (more than 70)
- more than 10 '$' signs on a line
- use file with CRLF endline and one other file with CR only
- characters after '!' in the same line
...
Pascal-78
13-Dec-12 11:04am
View
Now with your compiled program:
did you try to look at the "temp" variable content before the strlen(temp) call?
Did you try to call the Line_Address function with these parameters: ("student.txt", 0, 0) And did you get the expected string?
And in the keystroke[0] in main(), did you see the expected value?
Pascal-78
12-Dec-12 7:01am
View
What is your question?
It seems to be the normal behaviour when server is just installed.
Pascal-78
12-Dec-12 4:15am
View
You are saying you use a asp.net project. In this case, I think it is not possible for a server (connected to your MCP) to send an update to the client (the one who displays the textbox) without any request from the client.
With a WinForm project, I can imagine 2 solutions: events or polling.
Can you precise your project and the MCP2200 API possibilities?
Pascal-78
10-Dec-12 11:35am
View
Did your program built successfully? When build failed, VS2010 may start the older version (the last successful built) generally after asking the user to do so.
Pascal-78
10-Dec-12 11:18am
View
Someone in codeproject already wrote an article about .NET Remoting events:
http://www.codeproject.com/Articles/62813/NET-Remoting-Events-Explained
Pascal-78
10-Dec-12 10:51am
View
Adding text to an unique id does not keep it unique.
A + BC + D = AB + C + D = ABCD
A & AB are different strings but with added characters the result strings are identical.
Pascal-78
10-Dec-12 8:11am
View
Can you post a small project that reproduces this behaviour?
Pascal-78
7-Dec-12 18:04pm
View
Have you tried this ?
IrrKlang.ISoundEngine engine = new IrrKlang.ISoundEngine();
IrrKlang.ISoundSource source = engine.AddSoundSourceFromMemory(Properties.Resources.Xaser_Aeolus,"Xaser_Aeolus.it");
engine.play2D("Xaser_Aeolus.it");
Pascal-78
7-Dec-12 17:37pm
View
As I wrote in the updated solution, the IrrKlang library must have a file extension in the name. In your case, it must be ".it".
You create the SoundSource using the AddSoundSourceFromMemory with the resource and a name with this extension (for example: "Xaser_Aeolus.it") and then you can use that name in the play2D method (without any path). The engine will not access a file of this name but the sound source you have create with that name.
Pascal-78
7-Dec-12 17:12pm
View
OK, I made some test and here are my results :
the name in the AddSoundSourceFromMemory must contains the file extension (I tried with "test.mp3")
Then I was able to play sound using directly this name or the source:
IrrKlang.ISoundEngine engine = new IrrKlang.ISoundEngine();
IrrKlang.ISoundSource source = engine.AddSoundSourceFromMemory(Properties.Resources.test, "test.mp3");
engine.Play2D(source,false,false,false);
System.Threading.Thread.Sleep(5000);
engine.StopAllSounds();
engine.Play2D("test.mp3");
System.Threading.Thread.Sleep(5000);
engine.StopAllSounds();
And of course, I do not have any "test.mp3" file.
Pascal-78
7-Dec-12 11:05am
View
I'm only reading the IrrKlang documentation on Internet (http://www.ambiera.com/irrklang/docunet/IrrKlang.ISoundEngine.Play2D_overload_1.html)
May be you can try with the name used in AddSoundSourceFromMemory ("Xaser_Aeolus").
or check if you have the last IrrKlang library.
If I have time, I might download the IrrKlang library and do some test.
Pascal-78
7-Dec-12 10:23am
View
I think you put the engine as the first argument of play2D, you should put the source (the object returned by the AddSoundSource....)
The MemoryStream object is in namespace System.IO (System.IO.MemoryStream)
Pascal-78
7-Dec-12 4:43am
View
I looked in the IrrKlang API.NET.
I think you use the ISoundEngine to play sounds.
using this object, you can create a ISoundSource with the method AddSoundSourceFromMemory and then use it in the play2D method of the ISoundSource.
IrrKlang.ISoundEngine engine = new IrrKlang.ISoundEngine();
IrrKlang.ISoundSource source = engine.AddSoundSourceFromMemory(Properties.Resources.Xaser_Aeolus,"Xaser_Aeolus");
engine.play2D(source, false, false, true);
engine.RemoveSoundSource("Xaser_Aeolus");
If it didn't work, you can try create a Sound Source from a MemoryStream :
engine.AddSoundSourceFromIOStream(new MemoryStream(Properties.Resources.Xaser_Aeolus), "Xaser_Aeolus")
Pascal-78
6-Dec-12 15:42pm
View
In case of "other", the resource should be available as a Stream like an opened file.
Pascal-78
5-Dec-12 3:27am
View
WCF is only a set of API in the .NET Framework. It will internally use those kinds of functions.
You can also read this article from Microsoft : http://msdn.microsoft.com/en-us/library/ff647503.aspx (Chapter 5: Authentication, Authorization, and Identities in WCF)
Pascal-78
3-Dec-12 5:27am
View
Have you tried to dispose the mail object only in the SendCompleted event ? (or not disposed it)
you may exit the SendAsync function and dispose the mail object before it is used by the smtp object.
Pascal-78
29-Nov-12 18:18pm
View
In recursive code, you MUST use local variables (in your case : odd and even must be local arrays)
Try to write the content of odd array at each step :
step 1 odd=[1,3,5]
step 2 (CreateOdd on odd) odd=[1,5] (but last five still in memory so [1,5,5]
step 3 (CreateOdd on odd (as [1,5]) odd=[1] displays 1
step 4 (CreateEven on odd (as [1,5]) even=[5] display 5
step 5 (CreateEven on odd (with 3 items)) even=[5] you expect 3 but remember odd is [1,5,5] when you call CreateEven at this level
Pascal-78
29-Nov-12 17:48pm
View
Let's take an example for n/2+n%2
n=4 => n/2 + n%2 = 4/2 + 4%2 = 2 + 0 = 2 = n/2 (n%2==0)
n=5 => n/2 + n%2 = 5/2 + 5%2 = 2 + 1 = 3 = n/2 + 1 (n%2==1)
with the same formula, you can use the same code when n is odd or even, and you don't need to test n%2.
Concerning my remark on C++ array, don't take it personnaly, it was just a remark. I understood you starts your array at index 1, and it may be easier to understand that CreateOdd function want to put odd-indexed items in odd array (with the usual convention 1st item will have index=0 and 0 is not odd :) )
Pascal-78
22-Nov-12 15:54pm
View
I already tried to use ActiveX/COM with Borland, but I get some difficulties (same kind as __stdcall). Do you know the option in Borland C++ 2009 to avoid this trick?
I would like very much to use C# but it is difficult to rewrite an existing software (written with Borland and its old VCL). That's why we want to extract some part of code in DLLs compiled with Visual Studio to get less and less code with the VCL (still without 64bit OS support)
Pascal-78
22-Nov-12 11:56am
View
I must agree. At the beginning of the project ActiveX/COM interfaces seem to be too much, but now with the compiler interactions, it looks like the easiest solution (without removing one of the compilers :) ).
Pascal-78
22-Nov-12 3:34am
View
Exactly what I meant.
IA is in fact similar to the IUnknown of the COM/ActiveX with the AddRef, Release and QueryInterface methods.
Virtual inheritance is used because "interface" is not really available in C++ like it is in C# or Java. Without virtual inheritance, I will have 2 "IA" in the D class (one from IB, and the other one from IC).
If I do not inherit IB and IC from IA and add all the IA methods in IB and IC, I create an A class with partial implementation of IA (the AddRef and Release method), I want to create the D class with A as a base class (to avoid rewriting common method each time I create a new class with IA interface) and IB and IC as new interfaces.
class D : public A, public IB, public IC;
in this case D is still abstract because AddRef and Release from IB and IC are not implemented in D but in A
Pascal-78
21-Nov-12 15:47pm
View
The only problem is with virtual inheritance. Remove all the "virtual" keyword in class inheritance (not in the method definition) and it will work with a Microsoft DLL and a Borland Program. It seems that virtual table constructions are compatible at the method level but not at the class level. I think that why the call to IA::methodInA still works with virtual inheritance because IA does not have any inheritance.
Show More