15,911,762 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 Chris Reynolds (UK) (Top 61 by date)
Chris Reynolds (UK)
27-Feb-13 6:54am
View
What do you think is wrong? You haven't said what is happening that is unexpected. I can see a problem if fsensorvalue1 is a float as a value of 29.5 will fall between the two ifs.
Chris Reynolds (UK)
26-Feb-13 9:05am
View
One thing to bear in mind that when a service starts there may well be no user logged on. Also a server could have multiple sessions, which user session's credentials would you use?
Chris Reynolds (UK)
26-Feb-13 5:07am
View
You need to give a lot more detail if you want any help. How much XML? What database server are you looking to load it into? What is the structure of the XML, give a small sample? Do you have an existing DB schema or can you create a new one?
Chris Reynolds (UK)
26-Feb-13 5:00am
View
Put some break points in and break the problem down. Is the first part definitely populating your list correctly? Then single step through your matching code to see if the comparisons are what you expect. Some time spent learning how to use the debugger to set breakpoints and inspect variables will save you a lot of time and you'll find solutions faster than us doing a static analysis of your code.
Chris Reynolds (UK)
25-Feb-13 7:20am
View
Also there is the 'Register for COM interop' option in Project Settings|Build tab which should be ticked
Chris Reynolds (UK)
25-Feb-13 7:16am
View
I'd guess that there is something wrong with the bitmap coming in on the event args. Can you check what Width and Height are of the passed in image - you may need to sanity check them.
LiveImage = (Bitmap)eventArgs.Frame.Clone();
Bitmap newBitmap = new Bitmap(LiveImage.Width, LiveImage.Height);
Chris Reynolds (UK)
25-Feb-13 5:39am
View
That's the article I used when I did this recently and it did the trick for me.
Chris Reynolds (UK)
25-Feb-13 4:53am
View
Yes, you're asking for the Control interface:
pVmr->QueryInterface(IID_IVMRMixerControl9, (void**)&pMixerBmp);
Chris Reynolds (UK)
25-Feb-13 4:11am
View
Well I think it might be because that interface (IVMRMixerControl9) doesn't support a methiod called SetAlphaBitmap:
http://msdn.microsoft.com/en-gb/library/windows/desktop/dd390457(v=vs.85).aspx
I think you may need to get a different interface
Chris Reynolds (UK)
22-Feb-13 10:22am
View
To an extent developers shouldn't care. But if you know that your 1 bit of data will carry an overhead you might choose to design your system to batch up requests into larger groups so that you only send one (for example) 64 byte packet rather then 64x8x64 byte packets. If it is a mobile app and people are being charged for their network usage then you should consider optimising your use of the resource. However, as ryanb231 says, it will be difficult for you to know what wrapper get put around your data as it moves up the OSI layers.
Chris Reynolds (UK)
22-Feb-13 9:46am
View
It should be fairly straightforward to convert the C# into VB, the .NET framework is the same for both so just take it a line or two at a time and you should be OK
Chris Reynolds (UK)
22-Feb-13 9:43am
View
Any idea which line is throwing the exception?
Chris Reynolds (UK)
22-Feb-13 9:20am
View
Are you getting an error? If so, what is it?
Chris Reynolds (UK)
22-Feb-13 7:56am
View
That sounds like it is using your IP address to determine your location not GPS. Is this when you run the app on the actual device?
Chris Reynolds (UK)
22-Feb-13 7:46am
View
I have updated the solution for you.
Chris Reynolds (UK)
22-Feb-13 6:05am
View
What have you tried so far? Have a go and then post what you've done - don't expect us to write all your work for you.
Chris Reynolds (UK)
21-Feb-13 12:36pm
View
Dashing this off before I go home without testing, but you should be able to get the answer from the link. Basically, create variables in the loop
for (int x = 0; x < numberOfResults; x++)
{
// Get vales
string LoopvesselName = e.Result[x].Vessel_Name;
int loopx = x;
sHeadline[x].MouseLeftButtonDown += new MouseButtonEventHandler((object senderH, MouseButtonEventArgs eH) => sHeadline_MouseLeftButtonDown(senderH, eH, LoopvesselName, loopx));
}
Chris Reynolds (UK)
21-Feb-13 12:13pm
View
With only one sample string it is difficult to give an answer. Post any ideas you've tried already and more of your sample data so that we can help
Chris Reynolds (UK)
21-Feb-13 10:33am
View
Worth using Process Monitor from Sysinternals http://technet.microsoft.com/en-gb/sysinternals/bb896645.aspx to see exactly what is happening. You'll then see exactly what keys are being written to and read from, also you'll see any permissions errors as noted by chill60 above. Well worth getting acquainted with that tool for this sort of problem.
Chris Reynolds (UK)
18-Feb-13 8:32am
View
I've no idea but it isn't something daft where a rectangle is sized have a top left of (0,0) and a bottom right of (1024, 768) rather than a width of 1024 and height of 768 as the former would give you a bonus pixel. Without more of your code it is difficult to tell, but that sort of thing has caught me before.
Chris Reynolds (UK)
18-Feb-13 8:14am
View
I'm reading your code and I think you've got very confused over the names of your classes and methods.
In the last block shouldn't the line
ProdutTypeMaster PTM = new ProdutTypeMaster();
be
ProdutTypeMaster PTM = new ProductInfo();
As I say, it is difficult to be sure though as you seem unsure of what is a class and what is a method.
Chris Reynolds (UK)
16-Feb-13 4:12am
View
And that's what I thought too, hence my hesitancy in the answer, thanks for confirming. But I pasted the OP's code and XML into VS and the only way I could get the SelectSingleNode to work was to include the namespace. Feel free to have a dig at it yourself as I'm away from work now and can't get at the code I hacked together yesterday
Chris Reynolds (UK)
15-Feb-13 12:22pm
View
The scrollbars will appear when you have content that needs them so if you add a load of extra text to your page they should appear, the image on its own won't cause the scrollbars. Hope that makes sense.
Chris Reynolds (UK)
15-Feb-13 9:58am
View
The nearest you'll get is sprintf for formatting output and sscanf for parsing an input string. You could probably write a routine to convert standard COBOL picture formats to a sprintf format specifier, the commas will be a problem though.
Chris Reynolds (UK)
15-Feb-13 9:53am
View
You're probably right - I'm only doing this to build my skills up while I look for a job so I can't be too bothered about the rep thing. Thanks for the thought.
Chris Reynolds (UK)
15-Feb-13 9:52am
View
I have just taken your C# code and your stored proc and created a similar set up here and it is working fine. If I pass null in as my name and code then I get the error you describe.
So a call to your function like this works fine:
InsertClass("King", "Lear");
and this one gives the error:
InsertClass(null, null);
Can you step through your InsertClass method and verify whether name and class are null. I am sure that if you pass them in hard coded then it should work fine as there is nothing wrong with the way you are calling the SP that I can see.
Chris Reynolds (UK)
15-Feb-13 9:14am
View
Thank you, that helps. Are you saying that your variables in the C# code called 'name' and 'code' are null. What happens if you hard code a value like this:
cmd.Parameters.AddWithValue("@name", "Test Name");
cmd.Parameters.AddWithValue("@code", "Test Code");
does the code work then? If it does then you need to look into whatever is calling this method as it may be passing in null values.
Chris Reynolds (UK)
15-Feb-13 8:50am
View
Just to confirm. Are you seeing any error message/exceptions raised or does your code run through cleanly but no rows are appearing on the database.
Have you tried testing your stored procedure using SQL Server Management Studio (or Query Analyser)?
When you have a problem like this it does help to break it into pieces.
Chris Reynolds (UK)
15-Feb-13 8:29am
View
Even nicer
Chris Reynolds (UK)
15-Feb-13 8:15am
View
Can we see the contents of your 'InsClass' stored procedure?
Chris Reynolds (UK)
15-Feb-13 5:41am
View
Updated solution for functions
Chris Reynolds (UK)
15-Feb-13 5:38am
View
Nowhere near enough detail to help. Start at zero and add one each time would work, but eventually you will run out of numbers. Each time your program starts should it carry on from where it left off? How do you plan to store the numbers you have already used. Please improve the question.
Chris Reynolds (UK)
15-Feb-13 5:25am
View
I answered this under your other question
Chris Reynolds (UK)
15-Feb-13 4:56am
View
What do you expect the code to do? Are you seeing an error or an unexpected result?
Chris Reynolds (UK)
14-Feb-13 12:04pm
View
Have you looked into Reflection?
Chris Reynolds (UK)
14-Feb-13 11:51am
View
Good answer, well phrased. Even if you had offered us your ideas (which you didn't) your tutor should be your guide and judge.
Chris Reynolds (UK)
14-Feb-13 11:47am
View
I think some of your code didn't get posted as I'm only seeing the beginning and end of a SQL UDF
Chris Reynolds (UK)
14-Feb-13 11:13am
View
Good spot and that is why the digitValue variable should be private so that your calling code can only operate through DisplayDigit.
Chris Reynolds (UK)
14-Feb-13 10:29am
View
What triggers your client application to send screenshots - is it on a timer? Without knowing a little more about how your application is constructed it is hard to help. Also if you want us to help you it is better for you to describe RM Tutor rather than asking us to google it - everybody's time is precious and it is you who want the help.
Chris Reynolds (UK)
14-Feb-13 10:08am
View
Is there a reason you want to do this using TCP as there are other, simpler, ways
Chris Reynolds (UK)
14-Feb-13 10:00am
View
Sounds like you need a trigger. There are plenty of examples around on the web. If you tell us what you want to do when a record is deleted we can offer more specific help.
Chris Reynolds (UK)
14-Feb-13 4:13am
View
Yes, back on topic. I guess we need to work through eliminating some things. That error makes it look like the method isn't present in the DLL but we could do with checking we're running the right DLL.
Have you stopped and started the SQL Server instance? It may be that the old version of the DLL is still in memory and so your new one isn't being loaded.
If you've tried that and it doesn't work, if you can run regedit on the server and find the entry under HKEY_CLASSES_ROOT for 'GMSAutoRoll.clsRole'.
It should have a single CLSID entry underneath it of the form {xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx}.
There should be a key with this CLSID under HKEY_CLASSES_ROOT\CLSID.
Under this key you should find an InprocServer32 entry. You need to check that this has a value that points to your new DLL.
I can't imagine that this will be wrong if you have followed the regsvr32 steps you put in your post.
If the restart SQL doesn't work I think we need to get some tracing in the COM DLL. I'll have a think.
Chris Reynolds (UK)
13-Feb-13 11:58am
View
And in that there is some truth. At some point all systems may need to be re-developed, an issue that is greater in the Windows world than, say, IBM mainframes where the tools to recompile COBOL etc from the 1970s still exist. In the Windows world we are dependent on tool vendors continuing to support old versions and Microsoft are not keen to maintain support for the VB6 development tools under new OSes even though the runtime persists. So, yes, companies with large suites of VB6 may need to re-develop due to platform incompatibilities. However this is not a fault of the language, just the choice of the vendor. Programmers do not always get the chance to choose when to redevelop a system although they can offer that opinion. In the mean time I don't see a problem helping other developers who have issues with any programming language.
Chris Reynolds (UK)
13-Feb-13 11:41am
View
You've chosen to vent your opinions on a programming language that the OP asserts it is beyond his remit to switch from.
To use your analogy. VB6 is an old horse that a lot of people have travelled many happy miles on and still works. COBOL is an old horse, PL1 is an old horse. Maybe you wouldn't buy those horses today but they aren't dead and have miles left in them.
As you requested, I've just looked around and seen a team of programmers who can code in a number of languages very well including VB6, C#, PL1 and others as occasion and requirement demands - they all seem happy enough.
Chris Reynolds (UK)
13-Feb-13 11:09am
View
Can you post sample contents of your file?
Chris Reynolds (UK)
13-Feb-13 11:02am
View
Looking at the serialization code being linked to it already loads and saves the tag for each node so you probably only need the second two code segments .
Chris Reynolds (UK)
13-Feb-13 10:59am
View
Is the value held as a string in your file? Is it the only thing in the file?
If it is a string then using the TryParse functions to convert it into a number and then dividing the result by 100 would be one way of doing it.
Chris Reynolds (UK)
13-Feb-13 10:45am
View
What have you tried?
Chris Reynolds (UK)
13-Feb-13 9:10am
View
It is worth understanding why you may want to stop the fetch early. Depending on the nature of the query then all of the hard work may have been done before you start retrieving rows as the actual building of the query can take the most time if there are complex joins and slection criteria involved. The actual retrieval of rows may be only a small part of your total time to populate. Have you tried any ideas out?
Chris Reynolds (UK)
13-Feb-13 4:32am
View
How does this diatribe meet "Let's work to help developers, not make them feel stupid.".
VB6 is still behind many core systems of large companies. Sure there are better choices now but redeveloping a large system isn't always an option.
Chris Reynolds (UK)
13-Feb-13 4:28am
View
When you call sp_OACreate do you pass a progid (such as "GMSAutoRoll.clsRoll") or a clsid (a GUID) as that will alter how COM chooses which DLL to service the request.
Chris Reynolds (UK)
8-Feb-13 6:49am
View
If you mean the caret which is the little I shaped bar that shows your position in the text box then you can use SelectionStart and SelectionLength but the double clicking will mean that a whole word is selected and so the caret is moved to the end of the word. Can you explain more clearly why you want the information?
Chris Reynolds (UK)
8-Feb-13 5:49am
View
You don't have a FULLNAME column in your table but the line of code I gave you in my solution means that your C# 'sees' a FULLNAME column in the result set that comes back from SQL and so your data field can be set to have a source of 'FULLNAME'
Chris Reynolds (UK)
8-Feb-13 4:54am
View
You should set it to FULLNAME as I suggested in my sample. Basically you are creating a pseudo-column with your SQL so you can set your RptTextBox to point to that new column
Chris Reynolds (UK)
8-Feb-13 4:02am
View
If what he's saying is that he wants null (and I assume that this is a database null rather than the literal) to be treated as starting with the letter n and being sorted as though it were the literal 'null' then he could cheat and do something like:
SELECT Col1 from Table order by ISNULL(Col1, 'null')
which would fool the sort order.
Chris Reynolds (UK)
7-Feb-13 11:32am
View
I'm not quite sure what you're trying to do as you're looping through each line in the file, then looping through rows in a list so you're processing the line too often as you'll have exhausted the line by the time you've completed the first iteration round the ii loop. Other than that I'd check for Position != -1 rather than Token !=" " in your while loop
Chris Reynolds (UK)
7-Feb-13 10:15am
View
Agree with the above two posters but also bear in mind that in 5 years time someone will want it updated again so, as SA said, try to seperate business function from GUI to make it easier for the next GUI face lift. Sounds like you'll be busy for a while.
Chris Reynolds (UK)
7-Feb-13 10:01am
View
If you're looking for a tool that offers as much built in help and support as VS does for Windows development but will build for multiple target platforms you will struggle. You need to find a GUI toolkit that is available on all the platforms that you want to develop for and then find a dev environment that supports both
Chris Reynolds (UK)
7-Feb-13 9:36am
View
Are you looking for something like GTK+ which is a cross-platform GUI toolkit?
Why don't you want to use VS? If you tell us why not it can help in pointing you to alternatives.
Chris Reynolds (UK)
7-Feb-13 9:21am
View
I think we need to know why you can't use ORDER BY as this is the only way that you can be sure what order your result set will appear in.
Chris Reynolds (UK)
7-Feb-13 9:16am
View
Have you tried specifying the SQL instance with the -S parameter?
Show More