|
Thanks. It compiles.
Since the square brackets have a higher precedence than the de-referencing operator, this declares an array of 6 pointers to the type float
Any comments please?
Thanks
modified on Wednesday, May 5, 2010 7:12 PM
|
|
|
|
|
I would suggest you spend some time practicing reading declarations using the right-left rule[^]. It's invaluable to really understand what's going on.
The wonderful thing about the Darwin Awards is that everyone wins, especially the members of the audience.
|
|
|
|
|
It compiles. I run the function and it give me error:
DAMAGE: after normal block (#125) at 0x00E40610
Thank you.
|
|
|
|
|
times(float (*delms)[6]) will work.
|
|
|
|
|
Thanks,I changed the code to what you suggest:
declare:
void class:time(float (*delms)[6]);
define:
void class:time(float *delms)[6]) { ...};
but the call:
time(delms)
not compile, giving error:
error C2664: 'time' : cannot convert parameter 1 from 'float ** ' to 'float (*)[6]'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\msw_give_out\msw_shotplus_i_format\class.cpp(2144) : error C2511: 'time' : overloaded member function 'void (float (*)[6])
' not found in 'class'
c:\msw_give_out\msw_shotplus_i_format\class.h(16) : see declaration of 'class'
feature_display.cpp
Error executing cl.exe.
blast_vib_multi_seed_model.exe - 2 error(s), 0 warning(s)
|
|
|
|
|
my fault not having seen your code before.
|
|
|
|
|
|
As has already been suggested, please spend some time (here, for example) knowing the differences/similarities between arrays and pointers when using functions. Without that knowledge, you are going to continue to face the same struggles.
That said, have you tried:
void CCvib_procDlg::time(float**, int dim1, int dim2);
...
time(delms, 1000, 6);
I would refrain from naming a function time() as it could be confused with the time() function.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi Guys, It works!
Here are codes to share with you and thanks. In particular, DavidCrow and _Superman_:
float **tim_var;
tim_var = new float*[1000]; <<----------
|
for (int x = 0; x < 1000; x++) |
{ |
tim_var[x] = new float[6]; <<----- |
| |
for (int y = 0; y < 6; y++) | |
tim_var[x][y] = 0.0; | |
} | |
| |
for (x = 0; x < 1000; x++) | |
delete [] tim_var[x]; <<---------- |
|
delete [] tim_var; <<-------------------
Above From: DavidCrow
How to pass 2D array in a function
Declare:
void Cvib_procDlg::delay_time(float *delms[6]);
Define:
void Cvib_procDlg::delay_time(float *delms[6])
{
....}
Call:
delay_time(delms);
From:
«_Superman_» I love work. It gives me something to do between weekends.
|
|
|
|
|
Dear Sirs,
I am beginner in C++ and have problem with one my program.
I am C++ dll for protection my Expert advisor(Metatrader software).
I want make demo version for my client and want using time limit on that.
For example each client able use this software for 7 days and after that not workable for him/her.
I want simple code that check this time for me.
I am using win32 console.
Thanks.
|
|
|
|
|
1- Don't waste time on that. If your program is worthy enough, then it WILL be cracked/hacked whatever you do and you will loose a lot of valuable time working on "security" instead on the core business of your application.
2- Release a version of your software with a limited set of function and features with code REMOVED from the executable. (for example no save/export/report, limit the number of trade per day/hours, ...)
...
Watched code never compiles.
|
|
|
|
|
dear sirs,
thank you for your email.
I want use this timer in dll no in original source.
You know cracking dll is hard.
Thanks.
|
|
|
|
|
I second Maximilien suggestion. Anyway, you may write usage info, crypted, inside the Windows registry.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Can anybody tell how I get the window handle from a specific process Id. I got the process Id using GetCurrentProcessId()
Regards
Rajmohan
|
|
|
|
|
Which window handle? There are usually more windows belonging to a process (e.g. controls on a dialog like buttons, edit fields have a window handle too). Anyways, i assume you are looking for a top level popup window, one method would be to enumerate all the windows, for example using EnumWindows[^], on every window you could call GetWindowThreadProcessId[^] to get the id of the process the window belongs to and test for equality...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
The handle of what window?
To retrieve all windows of a process, you have to call EnumWindows and, for each window, use GetWindowThreadProcessId to check if a window belongs to a process (the ProcessID of the window equals the ProcessID of the process).
|
|
|
|
|
EnumWindows function is working fine with all windows except my application. I will describe the issue in detail. I have a dll application and I have loaded it into App_Init folder, which loads for every application. I want to know which is currently loaded application and also I need to get the handle of the main window.
I used EnumWindows for navigating through opened application. It is calling for all the application except mine. I dont understand the issue can anybody help me.
Thanks in advance
Regards
Rajmohan
|
|
|
|
|
GetWindowThreadProcessId
what about this?
|
|
|
|
|
See here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
There is no single window handle. A process may have multiple main windows, or none at all. So you have to enumerate all windows, and select the ones which have no owner, and the correct process id. Those will be 'main' windows of the process.
And before thou protests:
Yes, I know that in .Net there is a property called System.Diagnostics.Process.MainWindowHandle, but the implementation is just plain wrong.
|
|
|
|
|
Thank you so much for all the support. I forget to mention the Window Handle,It is of-course the parent window itself
Regards
Rajmohan
|
|
|
|
|
EnumWindows function is working fine with all windows except my application. I will describe the issue in detail. I have a dll application and I have loaded it into App_Init folder, which loads for every application. I want to know which is currently loaded application and also I need to get the handle of the main window.
I used EnumWindows for navigating through opened application. It is calling for all the application except mine. I dont understand the issue can anybody help me.
Thanks in advance
Regards
Rajmohan
|
|
|
|
|
Hi,
I have a dll which is having pure virtual functions. Now what to do with that to redifine the function in my own class?
|
|
|
|
|
john5632 wrote: I have a dll which is having pure virtual functions. Now what to do with that to redifine the function in my own class?
The usual thing you do: derive your class from the abstract one and redefine the methods.
Only the header file of the DLL plays a role in such a game...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ok, Shell I do load the dll in memory.
Can you please tell the exact steps to do?
|
|
|
|