|
You're mixing managed and unmanaged code in a very strange way.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I know. This was the quick and dirty solution, but i'm open to alternatives.
|
|
|
|
|
How about using an <a href="http://msdn.microsoft.com/en-us/library/ts4c4dw6(VS.80).aspx">array</a><<a href="http://msdn.microsoft.com/en-us/library/system.string(VS.80).aspx">String</a>^>^ (i.e. a C++/CLI array of C++/CLI strings) instead of standard C types?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Well, I need the array in that format because I'm working with another proprietary API that works only with standard C types.
|
|
|
|
|
jlgeris wrote: temp[count]
When you allocated temp, you allocated temp[0] to temp[count-1] - temp[count] is undefined. Either use a different index variable or reset count to 0
jlgeris wrote: strlen(x)*sizeof(char)+1
As sizeof(char)==1, it makes no difference, but you really wanted (strlen(x)+1)*sizeof(char)
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello,
my program takes in a large file(s) of byte code and writes it into thousands of smaller files.
The program gives an MFC42D.DLL: 0xC00000005 Access Violation when it reaches the first of two lines of code below.
<pre> siteAndChannelIDStr.Format("C:\\Network Data\\Unclassified Events\\Last Extracted\\%s\\#%d\\", siteNamesArray[listBoxIndex], OCUIDfromEALFile);
CreateDirectory(siteAndChannelIDStr, NULL);
The CString object and directory are successfully created during the previous iterations, but oddly fails this time round.
I have followed the program execution using the debugger and it falls down at "if" statement in the "Advanced direct buffer access" bit in MFC\SRC\STRCORE.cpp
<code> if (GetData()->nRefs > 1 || nMinBufLength > GetData()->nAllocLength)
I have tried setting siteAndChannelIDStr = ""; after use
And changing the Format function to one described on the microsoft website <a href="http://support.microsoft.com/kb/127038"></a>
And tried using CString Arrays for the siteNamesArray
But no luck!
Has anyone come across this type of problem before?
I have tried the program out on 3 different files, but it fails at the same line (although prog had passed this line for each previous hundreds of iterations)
It fails after subfile 4977/10893 in file1
after subfile 4901/8135 in file2
after subfile 384/13321 in file3
Any help would be greatly appreciated!
I can provide more information if necessary. I cannot put up source code as it is for my work.
Thanks,
Colm
|
|
|
|
|
The error implies GetData() is returning zero - why is that happening?
Are you running out of memory possibly?
What are the parameter values going into the function?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Just checked in the debugger and nMinBufLength is 91 for the other calls to GetBuffer() is only 55 on the call that causes the error.
So I think running out of memeory is the problem somehow...
I've tried siteAndChannelIDStr.ReleaseBuffer(); and siteAndChannelIDStr = "";
I tried shortening the lenght of the filePath and it is still failing at the same location.
What params do you require -
I cannot get anymore values - for previous iterations nRefs=-1, nDataLength=0, nAllocLength=0
Thanks again,
Colm
|
|
|
|
|
colm omahony wrote: Just checked in the debugger and nMinBufLength is 91 for the other calls to GetBuffer() is only 55 on the call that causes the error.
So I think running out of memeory is the problem somehow...
In that case, you need to be releasing memory somewhere - but what is it that's taking up all the memory?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi, I was on holidays for last while. Thanks for assistance. Will look into what is taking the memory.
|
|
|
|
|
Hello Stuart, is this a memory leak or is it likely to be something different. I am not getting a memory leak error message.
|
|
|
|
|
Either that or you're using an invalid string object in there somehow.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
OpenGL default background is black. I want the background is total transparent in Windows. Anyone has an example how to do it?
|
|
|
|
|
Never used it. A quick investigation using Google tells me that basically it is not directly supported. Some people have stated that this solution[^] works. Good luck.
|
|
|
|
|
|
This thread shows how: http://stackoverflow.com/q/4052940/176769
|
|
|
|
|
Hi all,
I have a dialog with some sliders on it. The slider are derived from CSliderCtrl.
I try to catch the LButtonDblClk message within my CSliderCtrl derived class, but the message does not arrive (Breakpoint is never hit). In the dialog the double click appears (breakpoint is hit), but only in case I click outside the slider controls. In case I click inside the slider controls nothing happens...
Any thoughts?
Regards,
jung-kreidler
|
|
|
|
|
jung-kreidler wrote: I try to catch the LButtonDblClk message within my CSliderCtrl derived class
How? Post the relevant code that is responsible.
Also I am not seeing any support for such a message in the documentation. Where have you seen information stating it does?
modified on Thursday, July 2, 2009 10:27 AM
|
|
|
|
|
The WM_LBUTTONDBLCLK can be handled with the message handler:
BEGIN_MESSAGE_MAP(MSlider, CSliderCtrl)
ON_WM_LBUTTONDBLCLK()
END_MESSAGE_MAP()
void MSlider::OnLButtonDblClk(UINT nFlags, CPoint point)
{
CSliderCtrl::OnLButtonDblClk(nFlags, point);
}
...guess you have seen such piece of code already...
|
|
|
|
|
jung-kreidler wrote: ON_WM_LBUTTONDBLCLK()
did u manually add this or using Class Wizard?
|
|
|
|
|
VS2008 automatic: Select class in Class View, Open Properties, Select Messages List, Add blahblah
I think it is of no relevance in what way the code has been added. The question is, why the breakpoint never gets hit in case I double click on the slider.
|
|
|
|
|
With following code i was able to get double click message in my Slider control.
I hope it works for you.
DWORD dwClssStyle = ::GetClassLong(m_slider.m_hWnd, GCL_STYLE);
dwClssStyle |= CS_DBLCLKS;
dwClssStyle = ::SetClassLong(m_slider.m_hWnd, GCL_STYLE, (LONG)dwClssStyle);
Regards,
Sandip.
|
|
|
|
|
Yep, that's it.
Thank you.
|
|
|
|
|
|
Thanks
I never thought any one would follow up such old message..
Regards,
Sandip.
|
|
|
|