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

C#

 
GeneralRe: Need help with some basic problems Pin
Christian Graus26-Mar-09 21:57
protectorChristian Graus26-Mar-09 21:57 
GeneralRe: Need help with some basic problems Pin
Tom Deketelaere26-Mar-09 22:34
professionalTom Deketelaere26-Mar-09 22:34 
AnswerRe: Need help with some basic problems Pin
benjymous27-Mar-09 0:49
benjymous27-Mar-09 0:49 
Questionusing SendMessage win32 things Pin
jeanbern26-Mar-09 16:03
jeanbern26-Mar-09 16:03 
AnswerRe: using SendMessage win32 things Pin
Dave Kreskowiak26-Mar-09 18:12
mveDave Kreskowiak26-Mar-09 18:12 
AnswerRe: using SendMessage win32 things Pin
Judah Gabriel Himango26-Mar-09 18:15
sponsorJudah Gabriel Himango26-Mar-09 18:15 
GeneralRe: using SendMessage win32 things Pin
jeanbern26-Mar-09 18:39
jeanbern26-Mar-09 18:39 
Questioncast to interface and then pass as ref Pin
devvvy26-Mar-09 14:18
devvvy26-Mar-09 14:18 
hello

I cast an instance member to an interface (IAddress), then pass it as "ref" to a method. Seems like after method returns the "interface" oAddress contains valid address loaded from database, while the original instance's member remains null - how can that happen..?

<br />
public class DAO<br />
{<br />
	...<br />
	public void DAO.LoadParentAddress(ref IAddress oAddress)<br />
	{<br />
	...<br />
	// load parent address from database, this is fine, i see oAddress been assigned to correctly.<br />
	oAddress = ....;<br />
	...<br />
	}<br />
	...<br />
}<br />
<br />
public class Program<br />
{<br />
	...<br />
	public void main(...)<br />
	{<br />
	...<br />
		DAO oDAO = new DAO(...);<br />
		IAddress oAddress = (IAddress) Person.ParentAddress;<br />
		oDAO.LoadParentAddress(ref oAddress);<br />
<br />
		// NUnit test/assert<br />
		Assert.IsNotNull(oAddress);				// This is fine.<br />
		Assert.IsNotNull(Person.ParentAddress); // This blow up! Person.ParentAddress is NULL while oAddress is NOT (i.e. oAddress has valid address)?!<br />
	}<br />
	...<br />
}<br />


dev

AnswerRe: cast to interface and then pass as ref Pin
_Maxxx_26-Mar-09 19:31
professional_Maxxx_26-Mar-09 19:31 
GeneralRe: cast to interface and then pass as ref Pin
devvvy26-Mar-09 19:39
devvvy26-Mar-09 19:39 
AnswerRe: cast to interface and then pass as ref Pin
S. Senthil Kumar27-Mar-09 7:00
S. Senthil Kumar27-Mar-09 7:00 
Questionhow to upload a file using ftp [modified] Pin
T_Teef26-Mar-09 13:25
T_Teef26-Mar-09 13:25 
QuestionFileNotFoundException error Pin
Member 462208926-Mar-09 13:15
Member 462208926-Mar-09 13:15 
AnswerRe: FileNotFoundException error Pin
T_Teef26-Mar-09 13:26
T_Teef26-Mar-09 13:26 
QuestionRe: FileNotFoundException error Pin
Adam Maras26-Mar-09 13:37
Adam Maras26-Mar-09 13:37 
AnswerRe: FileNotFoundException error Pin
Luc Pattyn26-Mar-09 15:34
sitebuilderLuc Pattyn26-Mar-09 15:34 
GeneralRe: FileNotFoundException error Pin
Member 462208927-Mar-09 5:28
Member 462208927-Mar-09 5:28 
GeneralRe: FileNotFoundException error Pin
Luc Pattyn27-Mar-09 5:56
sitebuilderLuc Pattyn27-Mar-09 5:56 
GeneralRe: FileNotFoundException error Pin
Member 462208927-Mar-09 6:19
Member 462208927-Mar-09 6:19 
GeneralRe: FileNotFoundException error Pin
Luc Pattyn27-Mar-09 6:53
sitebuilderLuc Pattyn27-Mar-09 6:53 
GeneralRe: FileNotFoundException error Pin
Member 462208927-Mar-09 11:50
Member 462208927-Mar-09 11:50 
GeneralRe: FileNotFoundException error Pin
Luc Pattyn27-Mar-09 19:16
sitebuilderLuc Pattyn27-Mar-09 19:16 
AnswerRe: FileNotFoundException error Pin
S. Senthil Kumar27-Mar-09 7:06
S. Senthil Kumar27-Mar-09 7:06 
QuestionCan you read session status from a windows service? Pin
Beyondard26-Mar-09 11:41
Beyondard26-Mar-09 11:41 
GeneralEditable Combobox Pin
OldSchoolToC#26-Mar-09 11:14
OldSchoolToC#26-Mar-09 11:14 

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.