|
Michael Dunn wrote: void foo(TagE (&the_array)[25]);
is there any difference between the above and void foo(TagE the_array[25]); ?
nave
|
|
|
|
|
Consider the case where you assign a new value to the_array inside foo() . When the_array is a reference, the change is visible to the caller. (I'm not positive, this is an area of black-magick syntax that I rarely venture into)
|
|
|
|
|
Ya in that case its ok. Like a double pointer na?
Thanks
nave
|
|
|
|
|
TagE the_array[20];
void foo(TagE the_array[25]);?
foo(the_array);
In this case, you can pass a pointer to the function.
TagE the_array[20];
void foo(TagE (&the_array)[25]);
foo(the_array);
But in this case, you should pass a correct arrary to the function(TagE the_array[25]; ).
|
|
|
|
|
i exactly definded you what i want .
in my DRmClient.cpp file
#include "TagEditor.h"
//// for tageditor class.
TagEditor _ProtectSet[MAX_PATH]; //global object
////
now i had fill up the object run time and try to pass this object to one function below
hr = pkg.EncodeMediaContent(wInFile,w_Output,hDlg,HOST,UserID,sINIT_PACKAGE_RESPONSE,COMMUNICATOR_SCRIPT_FILE_PATH,PORT,hList,_ProtectSet[25] );
the above function call the follwoing function
HRESULT Package::EncodeMediaContent(WCHAR *pszInFile, WCHAR *pszOutFile, HWND hwndParent, string Host,string UserID, string InitPackageRequest,string ScriptFile,INTERNET_PORT Port,HWND hList,TagEditor _ProtectSet[MAX_PATH])
{
//where i again pass that last parameter in other function
string sConfigureResponse = GenerateConfigurePackageRequest(UserID,Host,ScriptFile,Port,hwndParent,InitPackageRequest,w_KeyID,hList,_ProtectSet);
}
string Package::GenerateConfigurePackageRequest(std::string uid,std::string host, std::string scriptFile, INTERNET_PORT port, HWND hwndParent,string sInitPackagingResponse,WCHAR *w_KeyID,HWND hList,TagEditor _ProtectSet[])
{
//and here i am using the original object members
e.g. like
string Title = "";
Title=_ProtectSet[0].title;
// now got it!!.
}
}
Amit
|
|
|
|
|
amitmistry_petlad wrote: hr = pkg.EncodeMediaContent(wInFile,w_Output,hDlg,HOST,UserID,sINIT_PACKAGE_RESPONSE,COMMUNICATOR_SCRIPT_FILE_PATH,PORT,hList,_ProtectSet[25]);
why _ProtectSet[25]? Passing like this means you are passing only the 25th element of the array. Why dont you pass like
hr = pkg.EncodeMediaContent(wInFile,w_Output,hDlg,HOST,UserID,sINIT_PACKAGE_RESPONSE,COMMUNICATOR_SCRIPT_FILE_PATH,PORT,hList,_ProtectSet );
nave
|
|
|
|
|
ok fine suppose i will pass like that then
i should write pointer at recever end is it ?.
then how can i access the members.
because i passing this array object through two function
1) EncodeMediaContent(......,last param) //here i should put pointer
2) GenerateConfigurePackageRequest(..., last param )//here i should pointer
Both last param having the same.
so now you can give me the guide line.
i have take pointer at two place but let me know how can i got the objects value.
e.g.
Title=_ProtectSet[0].title;
Amit
|
|
|
|
|
amitmistry_petlad wrote: 1) EncodeMediaContent(......,last param) //here i should put pointer
2) GenerateConfigurePackageRequest(..., last param )//here i should pointer
you dont need to change this parameters. The current definition is ok. And even though u recieve a pointer in the last function, you will be able to use like
Title=_ProtectSet[0].title;
Modify the code as I said and try compliling the code. It should compile with zero errors.And let me know if there is any error.
nave
|
|
|
|
|
|
how can i print every page with a special style when i print a multi-page
document.for example,when i print the first page ,i want in A4,while the
second in A3.
hhhero
|
|
|
|
|
You will have to print the pages one by one, each time changing the printer settings to whatever size you want to use.
|
|
|
|
|
thanks WaldeMort!!!
i got it!!!
just call ResetDC after change a DEVMOD struct,that's ok!!!
thanks!!!
|
|
|
|
|
A modeless dialog(popup property) been created by a main dialog makes itself Transparent like this:
<br />
SetWindowLong(m_hWnd, GWL_EXSTYLE, GetWindowLong(m_hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);<br />
SetLayeredWindowAttributes(m_hWnd, 0, 85, LWA_ALPHA);<br />
The modeless dialog has some controls on it, for example buttons, lists etc.
some text will be added to the list sometimes, for example runing logs etc.
several hours later(screen protector has started, quit it), the modeless dialog remain a blank dialog, that is, all controls disappeared!
move the mouse on the buttons, and the buttons display.
left click the list, the row which is selected displays, others remain disappeared!
minimize the main dialog the restore it, all controls on the modeless dialog display.
The problem only occurs on Win2003 server.
The problem need a long time to occur!
someone please give some suggestion!
best regards!
|
|
|
|
|
|
int livesPos[] = {30, 15};
the '{' can only be used for variable instantiation and not later.
|
|
|
|
|
|
one good way would be to not have globals. Another would be to use a vector. A third would be
livesPos = new int[2];
livesPos[0] = 5;
livesPos[1] = 666;
or whatever.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
The problem with a global is that you can't debug it, or control it. At a minimum, create a class that has public static methods to get and set variables which are private. That way, you can set breakpoints if you need to debug access to the values. Even better, create a class with protected members, and make the classes you want to grant access, friends of that class.
Lord Kixdemp wrote: you do live here, don't you?
*grin* 14+ hours a day, yeah.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
That is all very nice and true only one problem: this guy said he used C and not C++..
I guess u could some OO implementation in C (header represents a class and each function takes a pointer to structure that represents 'this'), still u don't have encapsulation...
|
|
|
|
|
Oh, I missed that. Then, there's no way around it. C kind of sucks that way.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
What would you do without global variables?
|
|
|
|
|
|
Write maintainable code ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Maintainable code? What do you mean?
Windows Calculator told me I will die at 28.
|
|
|
|
|