|
thanks man,
that helps too
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi
How to know the parameters of an exported function from a dll. like NTDeleteFile exported from NTDLL.dll
Thanks
|
|
|
|
|
you can undecorate parameters of C++ functions using dependency walker but unfortunately it does not work with C functions
|
|
|
|
|
It's quite simple, you just disassemble the function and work it out from the stack.
Seriously, why do you want to use NtDeleteFile rather than the Win32 DeleteFile ? NtDeleteFile knows nothing of current directories and requires a fully specified path, in NT object manager format. In general, it's better to use the Win32 functions.
If you're looking to reuse a DLL for which you don't have documentation, my advice is not to bother. If the function is undocumented, you should consider it to be an implementation detail which could change in future versions of the DLL. Don't use it.
|
|
|
|
|
|
hello,
I am a begginer. i'm experimenting with a shellexec funtion to try and launch various things from my simple dialog based MFC application. Things like web pages, exe's, and files. I plan on just mapping them to a simple button. can anyone explain (in newb terms) how to get this function to work properly?? How to implement it and where exactly im supposed to add this code??
I would really appreciate any help, Thanks
|
|
|
|
|
In the resource editor, add a button to the dialog
Double click on the button. This adds a method to the dialog class
Add code for the handler.
From MSDN:
HINSTANCE ShellExecute(
HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
hwnd - 0 - don't worry about the parent window, set to NULL
lpOperation - "open" - open something
lpFile - "your.file" - the file or URL you want to open
lpParameters - "" - unless you need to pass in cmd line params
lpDirectory - "" - unless you care what directory the launched app starts in
nShowCmd - SW_SHOWNORMAL - this will be okay most of the time
ShellExecute(0,"open","http://www.codeproject.com","","",SW_SHOWNORMAL);
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
hi, thank you very much for the info! you got me on the right track.. however when i compile i get an error that reads:
error C2373: 'ShellExecuteA' : redefinition; different type modifiers
i dont know if i put all of the code in the right spot, i added it all under the button function:
void CShell2Dlg::OnButton1()
{
HINSTANCE ShellExecute(
HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
ShellExecute(0,"open","http://www.codeproject.com","","",SW_SHOWNORMAL);
}
--later
|
|
|
|
|
hi, i'm coding on an interactive sound filter system, but i have a little problem concerning FFT...
i've already coded a directsound micrphone capturing system, but i have the problem, that i don't know how to pass the captured data to a FFT algorithm.
does anyone know e.g. an open-source project which shows how to do this?
thx for advice!
Don't try it, just do it!
|
|
|
|
|
perhaps this helps you
#include <math.h>
#define SWAP(a,b) tempr=(a);(a)=(b);(b)=tempr
void fft(double data[], unsigned long nn, int isign)
{
unsigned long n,mmax,m,j,istep,i;
double wtemp,wr,wpr,wpi,wi,theta,tempr,tempi;
n=nn << 1;
j=1;
for (i=1;i<n;i+=2) {
="" if="" (j=""> i) {
SWAP(data[j],data[i]);
SWAP(data[j+1],data[i+1]);
}
m=n >> 1;
while (m >= 2 && j > m) {
j -= m;
m >>= 1;
}
j += m;
}
mmax=2;
while (n > mmax) {
istep=mmax << 1;
theta=isign*(6.28318530717959/mmax);
wtemp=sin(0.5*theta);
wpr = -2.0*wtemp*wtemp;
wpi=sin(theta);
wr=1.0;
wi=0.0;
for (m=1;m
|
|
|
|
|
I am currently working my way through one of these "Teach youself C++" courses, which has evaluations at the end of each section. Normally I ace these without a problem (I work as a C# coder, so most of this stuff isnt rocket science to me (well maybe with the exception of bitwise operators)).
What has me perplexed is this question in the evaluation :
(Two or more choices) Select the valid C++ expressions
A) char Team[11] = "Marketing"
B) double Grade
C) int 30 = a = b
D) Score = 90
E) x = 100
F) a = b = c = 25
G) PI = 3.14159
My answer was that A and C are incorrect, although A is "technically" correct the array is oversized for the value it is initialised with which is a waste or memory and C for obvious reasons.
Now according to the evaluation program B and C are incorrect, again C for obvious reasons, but whey is B wrong???
This is probably something really simple that I have probably missed, but I just cant see it - feel free to call me a moron, as long as you give me the reason why B is wrong.
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
I don't think b is incorrect.
MaestroProgramador.Com
I didn't fail hundred times, I found hundred ways that didn't work.
No fallé cien veces, encontré cien maneras de que no funcionara.
|
|
|
|
|
B is incorrect because double Grade is a declaration not an expression. This is a fine point of the language and not something I'd expect to show up in a beginner's book.
A is valid syntax, you don't have to initialize the entire array, and any extra elements will be initialized to zero. However, it is not an expression either.
C is not a valid expression because it's not even valid syntax.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
> A is valid syntax, you don't have to initialize the entire array, and any extra elements will be initialized to zero. However, it is not an expression either.
Would you expand on that a little further please
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
An expression is something that has a value. While "x = 100" might look like an assignment *statement*, it's actually an expression since it has a value that you can assign to another variable. When you write "a = b = 42", this is not just a special idiom of C++ syntax. "b = 42" is an expression that has the value 42 which then gets assigned to a i.e. "a = (b = 42)"
Mike's right - it's a very fine point
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.3 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Any suggestions on how to handle multiple developers concurrently working on the same .rc file (although on different dialogs)?
The problem as we all know has to do with resource ids getting munged. I'd prefer to not have to distribute our resources among different resource DLLs. We're using VC6 but plan to switch to VC7 (but stay with MFC) soon.
Thanks for any words of wisdom!
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
The simple answer unfortunately is don't use the VS editor. If you must, manage your resource IDs yourself. You can enter '=number' after a resource identifier in the resource editor to assign that number to the resource ID. You could consider using a small number of general IDs for general resources (perhaps Print buttons), then allocate a block of resource IDs to each dialog.
|
|
|
|
|
Thanks for your reply, Mike!
I'm aware of custom id assignment, and feel the process of reserving resource ids for different groups of controls is error-prone at best. I'm tempted to write a "resource id renumberer" that would be run prior to merging a checked in resource.h. It could also be run on-demand at any time to guarantee unique ids. But what a pain.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
October 18, 2003
Re: Microsoft Knowledge Base Article - 174942
"File Modified Outside Source Editor" Warning Message
I believe I have discovered a cause of this warning in a specific situation. I encountered this message while using Microsoft Visual C++ .NET. The message box appears after the “Build Solution” command is complete, following editing of a source file using the native .NET editor.
In this case, the project and source files were stored on a network file server. A tape backup job was running at the time on the file server when I encountered the warning. I moved the project and source files to the local hard drive on the workstation and didn’t get the error message. I moved the project and source files back to the file server after the tape backup job completed and didn’t get the warning then either.
Under Microsoft Visual C++ .NET, the window title is Microsoft Development Environment. The window displays the full path file name followed by the following message:
This file has been modified outside of the source editor.
Do you want to reload it?
The command buttons are: Yes, Yes to All, No, No to All.
The bottom line is that Visual Studio .NET may erroneously detect that a file has been modified outside of the source editor, in situations when there is a delay between the time the file is saved and when it is actually written to the network drive.
Carl Owenby
|
|
|
|
|
Hi all
How can i create a peer-2-peer direct connection using CSocket?
is there any way without using CSocket::Listen() ?
and another small think: what will happen if I'll try to listen to other procces's port?
thanks
|
|
|
|
|
hmmmm... please more precisly!
are u server, or client?
what do u mean with
lpRomang wrote:
other procces's port?
Don't try it, just do it!
|
|
|
|
|
Well, you can create a p2p connection by specifying to the CSocket object the IP address that you want to connect to. If you are listening to other port that you won't use, it will be listening all time for nothing.
Hope it helped.
MaestroProgramador.Com
I didn't fail hundred times, I found hundred ways that didn't work.
No fallé cien veces, encontré cien maneras de que no funcionara.
|
|
|
|
|
thanks to the people thar reply my outher message.
sorry i have posted a exe file, i know that you will not runit, so i have posted a zip this time.
here it is, a piece of code that i cant get to work.
is there anyone that can spend 5 min with this and tell what is not correct?
Test Project:
http://www.xwega.com/toolbartest.zip[^]
this is a simple sdi app made with the wiz.
i have only added the menu "test" and the toolbar buttons
I have created the menu event handlers
the problem is that the menuitem "Ball" can be disable but the button "ball" with the same id is allways enable.
there is code to enable and disable the menu and toolbar button on the menu event handlers.
what is incorrect?
MSN:maxsnts@hotmail.com
|
|
|
|
|
i didn't download ur code.
i guess the menu ID is not the same as the button ID.
includeh10
|
|
|
|
|
includeh10 wrote:
i guess the menu ID is not the same as the button ID.
no, that is not the problem.
MSN:maxsnts@hotmail.com
|
|
|
|