Click here to Skip to main content
15,898,987 members
Home / Discussions / C#
   

C#

 
QuestionHowTo Enumerate a systems DSN's ? Pin
Steve Cox9-Jan-03 5:28
Steve Cox9-Jan-03 5:28 
Questionhow to move the position of selected item in a listbox? Pin
fretre9-Jan-03 4:05
fretre9-Jan-03 4:05 
AnswerRe: how to move the position of selected item in a listbox? Pin
leppie9-Jan-03 6:10
leppie9-Jan-03 6:10 
QuestionHow to assign image pair to toolbar buttons? Pin
Smitha Nishant9-Jan-03 3:09
protectorSmitha Nishant9-Jan-03 3:09 
QuestionHas somebody already finished a Managed DX project? Pin
Zinj8-Jan-03 21:34
sussZinj8-Jan-03 21:34 
AnswerRe: Has somebody already finished a Managed DX project? Pin
leppie8-Jan-03 22:42
leppie8-Jan-03 22:42 
AnswerRe: Has somebody already finished a Managed DX project? Pin
Steve Maier18-Jan-03 17:34
professionalSteve Maier18-Jan-03 17:34 
GeneralDebug Crash / Variable - error: cannot obtain value Pin
kman8-Jan-03 17:25
kman8-Jan-03 17:25 
Question: I have this function that I call all thoughout my code. 90% of the time it works without a hitch. But lately when debugging it will give me the same error every time when the function below is executed in a certain place in my code.

When stepping over the bold line listed below, I get this popup:
TITLE = Microsoft Development Environment
MESSAGE = There is no source code available for the current location.


So, I tried calling the exact function call a half dozen times in different locations working my way back up the callstack. Higher in the callstack I have no problem. But go down 5 or so levels and KAPOW!

FileInfo *FileGetList(String *filePattern)[]<br />
{<br />
FileInfo *fileList[];<br />
String *directory = filePattern->Substring(0, filePattern->LastIndexOf("\\", filePattern->Length));<br />
	int pos = filePattern->LastIndexOf("\\", filePattern->Length) + 1;<br />
	String *pattern = filePattern->Substring(pos, filePattern->Length-pos);<br />
	DirectoryInfo *dir = new DirectoryInfo(directory);<br />
<br />
	fileList = dir->GetFiles(pattern);<br />
	<br />
	return fileList;<br />
}


The strange thing is, if this were not strange enough, I can step over the DirectoryInfo constructor with no error but when I expand the dir variable in the watch window, 3 of its member variables read: error: cannot obtain value. It is then that I know that the dir->GetFiles() command is going to go nuts.

Is there a posibility that the DirectoryInfo class I am constructing is not allocating correctly? Am I out of heap space? Am I making a stupid beginners mistake somewhere?

Help Confused | :confused:
GeneralRe: Debug Crash / Variable - error: cannot obtain value Pin
leppie8-Jan-03 22:45
leppie8-Jan-03 22:45 
GeneralRe: Debug Crash / Variable - error: cannot obtain value Pin
kman9-Jan-03 5:44
kman9-Jan-03 5:44 
GeneralLoading an assembly Pin
lustuyck8-Jan-03 11:43
lustuyck8-Jan-03 11:43 
GeneralRe: Loading an assembly Pin
lustuyck8-Jan-03 11:55
lustuyck8-Jan-03 11:55 
GeneralTable Information Pin
Jassim Rahma8-Jan-03 10:36
Jassim Rahma8-Jan-03 10:36 
GeneralMulti Columns comboBox Pin
Jassim Rahma8-Jan-03 10:32
Jassim Rahma8-Jan-03 10:32 
GeneralRe: Multi Columns comboBox Pin
David Stone8-Jan-03 14:02
sitebuilderDavid Stone8-Jan-03 14:02 
GeneralString Replacment Pin
Jassim Rahma8-Jan-03 10:27
Jassim Rahma8-Jan-03 10:27 
GeneralRe: String Replacment Pin
David Stone8-Jan-03 14:01
sitebuilderDavid Stone8-Jan-03 14:01 
GeneralATTN: Win CE experts Pin
Jassim Rahma8-Jan-03 10:16
Jassim Rahma8-Jan-03 10:16 
GeneralRe: ATTN: Win CE experts Pin
Codin' Carlos8-Jan-03 10:42
Codin' Carlos8-Jan-03 10:42 
GeneralRe: ATTN: Win CE experts - HERE YOU GO Pin
Codin' Carlos8-Jan-03 10:50
Codin' Carlos8-Jan-03 10:50 
GeneralRe: ATTN: Win CE experts Pin
Shaun Wilde10-Jan-03 5:22
Shaun Wilde10-Jan-03 5:22 
GeneralScreen Resolution Pin
Jassim Rahma8-Jan-03 10:12
Jassim Rahma8-Jan-03 10:12 
GeneralRe: Screen Resolution Pin
SHaroz9-Jan-03 13:21
SHaroz9-Jan-03 13:21 
GeneralConsolizing a Windows Form program Pin
Le centriste8-Jan-03 9:38
Le centriste8-Jan-03 9:38 
GeneralRe: Consolizing a Windows Form program Pin
leppie8-Jan-03 11:28
leppie8-Jan-03 11:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.