16,020,518 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 Visual Basic questions
View Javascript questions
View .NET 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 David_Pollard (Top 9 by date)
David_Pollard
23-Jun-16 23:27pm
View
OK, I had assumed it was PHP. It now appears to me to be some system of tag replacement used by thy web servers CMS.
FIY I have been programming for more than 25 years. In a language that I don't know I find it very useful to start with a working example and modify it to do what I need. It is hardly useful to learn something back to front when I'm only one line short of a working solution. My problem is I asked the question in the wrong place. I'll remove it.
Thanks
David
David_Pollard
6-Jun-16 4:19am
View
It is hard to know what is wrong with so little information coming back from your program. I usually include debugging information to a log file so I can tell where a program is up to when it stops. I also include a setting in the config file so I can turn logging down or off when you don't need it. At a minimum every method outputs its name and any variables passed in and the current date time. Years down the track this extra work can still pay off when a program in the field suddenly stops working.
David_Pollard
3-Jun-16 0:04am
View
Sorry, I haven't explained that part very well. I'm using an application named Policy Patrol that creates a backup in SQL Server of every email coming and going in the organisation. There is an option within that software that compresses the data in one column only, named RFC822_msg. If I turn the compression off it would be a breeze but it would also reduce the amount of history I can store by around half.
David_Pollard
1-Jun-16 20:45pm
View
I also sniffed the SQL when reading the data back from the database into the application and no sign of any decompression there either. Just two normal looking select statements.
David_Pollard
1-Jun-16 20:39pm
View
Hi OriginalGriff, That link points to SQL 2016 and I'm using 2008 R2. It is only one column in my table that is compressed. Not the whole table or Index. Let me know if I'm missing something.
I have sniffed the SQL using a profiler when the application writes to the database and it is a straight SQL Insert command with nothing special about any column. This is why I assumed that the application is doing the compression. Good idea but. :)
David_Pollard
29-Sep-15 2:49am
View
I put this problem on the back burner for a while and went on to other things.
When I came back I had no problem Binding the combo box to the data source exactly as you would expect. (In the GUI)
The solution you proposed looks very nice so I accepted it as an answer :)
David_Pollard
10-Apr-13 20:58pm
View
OK I have come up with a very simple example program.
The Main method calls Sub1 method to create an array.
The Main method outputs something from the array.
The Main method calls freeMem method to delete the array.
I don't know what I'm doing trying to pass pointers back and forward.
I have included the compile errors as comments below.
If I can get this example to work I should be able to extrapolate it to my actual problem.
Thanks
David
// TestMemoryLeak.cpp : main project file.
#include "stdafx.h"
// Added the follwoing lines for Memory Leak Detection
// Turned off Precompiled Headers in project options
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
// Refifines "new" when in debug mode
#ifdef _DEBUG
#ifndef DBG_NEW
#define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
#define new DBG_NEW
#endif
#endif
// End Memory Leak Detection Additions
using namespace System;
#define byte unsigned char
byte* sub1(int arraySize);
void freeMem(int pArray[]); // <-- Just guessing here
int main(array<system::string ^=""> ^args)
{
// Sets memory debug the output to go to the Output Window
_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_DEBUG );
int arraySize= 1000;
byte pByteArray;
// Create and Save stuff in the array
pByteArray = sub1(arraySize); //Error 1 error C2440: '=' : cannot convert from 'unsigned char *' to 'unsigned char'
//Just display something from the array
Console::WriteLine(&pByteArray[20]); //Error 2 error C2109: subscript requires array or pointer type
//Free the Memory
freeMem(pByteArray); //Error 3 error C2664: 'freeMem' : cannot convert parameter 1 from 'unsigned char' to 'int []'
// Output the memory leak debug info now.
_CrtDumpMemoryLeaks();
return 0;
}
byte* sub1(int arraySize)
{
// Create the Array
byte* byteArray = new byte [arraySize];
for(int count=1; count < arraySize; count++)
{
// Put stuff in array
byteArray[count]=120; //Just save something in the array.
}
return byteArray;
}
void freeMem(int pArray[])
{
// Destory the array
// or comment to make a leak
delete pArray; //Error 3 error C2541: 'delete' : cannot delete objects that are not pointers
pArray=0;
}
David_Pollard
10-Apr-13 6:21am
View
This will take me some trial and error. & and * together confuse the crap out of me.
I have created a bare bones (c++) console app for testing. I should be able to create the same leak in that and then fix it. If I come with a easily understandable example I'll post here.
David_Pollard
10-Apr-13 4:58am
View
Ok Thanks that makes some kind of sense. I can fix the code within the Dll.
Should the calling method also allocate the memory or is that ok left where it is?
How should the delete look? I don't want to just delete a pointer to the memory.
Sorry big newbie question I know.
Show More