Click here to Skip to main content
       

C#

 
Answer[Solved] Reading metadata from exported types with .net framework 3.5 PinmemberDanzy8315-Jan-13 12:52 
QuestionNLog question Pinmembervanikanc15-Jan-13 10:16 
AnswerRe: NLog question Pinmemberjibesh15-Jan-13 11:23 
AnswerRe: NLog question Pinmemberjschell16-Jan-13 9:23 
GeneralRe: NLog question Pinmembervanikanc16-Jan-13 9:34 
GeneralRe: NLog question Pinmemberjschell17-Jan-13 8:13 
QuestionAdd a dll reference from another server. Pinmembervanikanc15-Jan-13 9:55 
AnswerRe: Add a dll reference from another server. Pinmemberjibesh15-Jan-13 10:08 
AnswerRe: Add a dll reference from another server. PinmemberGarth J Lancaster15-Jan-13 10:14 
AnswerRe: Add a dll reference from another server. PinmvpAbhinav S15-Jan-13 21:42 
QuestionHow to show google zoom bar in my map ? Pinmembera1_shay15-Jan-13 8:26 
AnswerRe: How to show google zoom bar in my map ? PinprotectorPete O'Hanlon15-Jan-13 8:48 
QuestionWCF Self-Hosted REST service... how to create OperationContext?? PinmemberSledgeHammer0115-Jan-13 7:05 
QuestionHow to update progressBar from another class PinmemberMichCl15-Jan-13 4:17 
I have a form with a progressBar on it. I'm doing writes in another class (through my interface) and need to show my progress of doing the writes, but I'm getting an error message *. Hopefully someone has an idea how to get the error to go away and so I can update my progressBar from a different class.
 
I'm more of a C++ developer doing C#, so there might be something that an experienced C# person would know of that I'm missing.
 
It looks like this:
 
PC.cs [Design]
Form with progressBar displayed
 
PC.cs
private int writeIt(ref byte[] wDat, byte[] sDat)
{
     result = cr.ProcessTWriting(ref wDat, ref pb_Progress.Value); //this passes a ref to the progressBar value
}
 
* In the code above, I'm getting "A property, indexer or dynamic member access may not be passed as an out or ref parameter" error message.
 
My interface looks like this:
 
iCR.cs (which is in another VS project due to future CR6, etc. which will use the interface)
int ProcessTWriting(ref byte[] wDat, ref int pb_value);
 
Then, I want to pass my references (to progressBar value) to where I'm writing my bytes (i to 1024), and update the reference to the progressBar as it iterates through, writing to it's destination.
 
This would be in my CR5.cs which implements iCR.cs (and is in another VS project still...think Factory pattern):
public int ProcessTWriting(ref byte[] WDat, ref int pb_value)
{
        status = AttemptWrites(ref pb_value);
}              
 
And the method it calls:
private int AttemptWrites(ref int pb_value)
{
     for (int i = 0; i < ((wDat.Length) / 4); i++)
     {
        //as it does writes, I want to set pb_value here to % complete
     }
}
 
Does anyone have a suggestion how to get my progressBar to update as I iterate through each byte I'm writing in my other class? I've looked at a couple of similar situations and there do seem to be people passing an index of an array, but I'm having trouble figuring out how to apply them to my situation. If I assign pb_value to a temporary value, passing it as a reference, it won't update my progressBar.Value as I do my writes and update the temporary reference to the value. Here's the links I found on the topic:
http://stackoverflow.com/questions/4813289/a-property-indexer-or-dynamic-member-access-may-not-be-passed-as-an-out-or-ref[^]
http://stackoverflow.com/questions/12440013/a-property-indexer-or-dynamic-member-access-may-not-be-passed-as-an-out-or-ref[^]
http://stackoverflow.com/questions/4518956/a-property-or-indexer-may-not-be-passed-as-an-out-or-ref-parameter[^]
http://stackoverflow.com/questions/6492097/a-property-indexer-or-dynamic-member-access-may-not-be-passed-as-an-out-or-ref[^]
 
Hopefully it's not TMI, but I figure, the more info the better so people can see where I'm coming from.
SuggestionRe: How to update progressBar from another class PinmemberHuorSwords15-Jan-13 5:50 
GeneralRe: How to update progressBar from another class PinmemberMichCl15-Jan-13 7:47 
GeneralRe: How to update progressBar from another class PinmvpDave Kreskowiak15-Jan-13 8:03 
GeneralRe: How to update progressBar from another class Pinmemberjibesh15-Jan-13 8:54 
GeneralRe: How to update progressBar from another class PinmemberMichCl15-Jan-13 9:00 
GeneralRe: How to update progressBar from another class Pinmemberjibesh15-Jan-13 9:09 
GeneralRe: How to update progressBar from another class Pinmemberjibesh15-Jan-13 9:24 
GeneralRe: How to update progressBar from another class PinmemberMichCl15-Jan-13 9:55 
GeneralRe: How to update progressBar from another class Pinmemberjibesh15-Jan-13 10:06 
GeneralRe: How to update progressBar from another class PinmemberMichCl15-Jan-13 10:15 
GeneralRe: How to update progressBar from another class Pinmemberjibesh15-Jan-13 11:34 
GeneralRe: How to update progressBar from another class PinmemberMichCl17-Jan-13 5:18 
GeneralRe: How to update progressBar from another class Pinmemberjibesh17-Jan-13 8:17 
GeneralRe: How to update progressBar from another class PinmemberMichCl17-Jan-13 8:59 
GeneralRe: How to update progressBar from another class Pinmemberjibesh17-Jan-13 9:18 
GeneralRe: How to update progressBar from another class [modified] PinmemberMichCl17-Jan-13 9:44 
GeneralRe: How to update progressBar from another class Pinmemberjibesh17-Jan-13 10:24 
GeneralRe: How to update progressBar from another class PinmemberMichCl18-Jan-13 2:07 
GeneralRe: How to update progressBar from another class PinmemberMichCl18-Jan-13 7:16 
GeneralRe: How to update progressBar from another class Pinmemberjibesh18-Jan-13 13:55 
GeneralRe: How to update progressBar from another class PinmemberMichCl21-Jan-13 4:53 
GeneralRe: How to update progressBar from another class Pinmemberjibesh21-Jan-13 5:00 
GeneralRe: How to update progressBar from another class PinmemberMichCl21-Jan-13 5:01 
GeneralRe: How to update progressBar from another class Pinmemberjibesh21-Jan-13 5:02 
GeneralRe: How to update progressBar from another class PinmemberMichCl6-May-13 3:44 
QuestionIncluding a PDF file in SHFB generated .chm (Html Helpfile 1) [modified] Pinmembernite_hawk15-Jan-13 1:07 
AnswerRe: Including a PDF file in SHFB generated .chm (Html Helpfile 1) PinprotectorPete O'Hanlon15-Jan-13 3:28 
QuestionDirectX9 Pinmemberelectriac15-Jan-13 0:20 
AnswerRe: DirectX9 Pinmembermarkovl15-Jan-13 0:53 
GeneralRe: DirectX9 Pinmemberelectriac15-Jan-13 4:59 
GeneralRe: DirectX9 PinmvpDave Kreskowiak15-Jan-13 6:48 
GeneralRe: DirectX9 Pinmemberelectriac15-Jan-13 12:17 
GeneralRe: DirectX9 PinmvpDave Kreskowiak15-Jan-13 19:39 
GeneralRe: DirectX9 Pinmembermarkovl16-Jan-13 1:48 
GeneralRe: DirectX9 Pinmemberelectriac16-Jan-13 4:42 
QuestionDatagridview DataSource Change Auotmatically without need PinmemberMohamed Nabawy14-Jan-13 16:35 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 27 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid