|
|
Sh*** LOL
The first thing that i checked was GetConsoleScreenBufferInfo()
but i'v not seen the dwCursorPosition
Thanks for you help
|
|
|
|
|
No problem ....happens to me more than I care to admit.;)
|
|
|
|
|
I want hide or disable MyComputer or drives of the computer so that, after restarting the computer , MyComputer or drives is restored to normal state (visible/enable)
can any body help me?
H.R
|
|
|
|
|
you can hide MyComputer from the desktop or from the start menu by doing the following :
user key:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
NonEnum]
sys key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
NonEnum]
name: {20D04FE0-3AEA-1069-A2D8-08002B30309D}
type: REG_DWORD (Valeur DWORD)
value: (0 = show, 1 = hide)
|
|
|
|
|
Is there any API getting the filename and subfolder on a Folder?
|
|
|
|
|
Yes. Use the FindFirstFile() /FindNextFile() pair, or the CFileFind MFC class.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
In case you are looking for sdk api, you can use FindFirstFile and FindNextFile.
|
|
|
|
|
And see DlgDirList function.
|
|
|
|
|
Hi people,
I have got new project. The thing is to comunicate my last VC++ 6 programm with a PLC of Siemens. To do that I have to create a connection through serial port to the MPI adapter or to connect both (PC and PLC) through Ethernet.
The fact is that there already is an old DLL that was programmed to be used with VB 4 in the firm, but my project has been programmed in VC++ 6.
I would like to find good info about integrating extern DLL into a VC++ project , to know if I will have problems with the compatibility using that DLL and where can I find information about how to translate it to the needed one.
Any suggestion, web, tutorial... will be very wellcome.
Thanks.
P.S. Concrete questions will come soon :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
In past I had the opposite problem: I developed a dll in C++ and I was trying to use it from a VB program.
Then I found that only 'standard dlls' (written in C++) can be used from a VB application. The reason is mainly on how data structs are passed to the functions in the dll. The only way was to declare the functions as "extern C".
You have to do this in the opposite way: find a way to create a standard dll in basic, then you can use it in C++.
Have you got the code of the dll? Can you recompile it?
Elseway, can you prepare a wrapper (in basic) to call the functions on the old dll, and compile it as a standard dll?
Russell
|
|
|
|
|
Yes,
the DLL is in the archives of the firm. It works with an old programm, but I made an upgrade to VC++ 6 of that programm as final studies project, and now I need to connect my programm with a S7-Plc. I can get the code of the old DLL, but I'm completely newbie with that (never used / seen a DLL internally) and I have not much time. The complete project has to be ready before New Year's Eve sigh:
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: I can get the code of the old DLL
great!
Nelek wrote: I can get the code of the old DLL, but I'm completely newbie with that
You don't have to rewrite nothing: look only on the web on how write a "standard dll" in basic...probally you have only to change some options before compile the dll, or add some lines somewhere in your project
Russell
|
|
|
|
|
And writing in standard basic will be accepted by the VC++? Just some changes and compile in VC 6?
That would be great, to save so much time, will save my own ass :P I will be able to concentrate in the PLC-programm. If I have time at the end... I will try to make my own DLL to comunicate through Ethernet insteads of Serial-MPI to learn about the thema, but when my placement is not in danger.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
probally this could help
http://www.freevbcode.com/ShowCode.asp?ID=3492[^]
It is an exaple on how write a c++ dll and use it in basic, so it is the opposite case.
But, in your case, the sintax that yiu have to use, must be the same(I think)!
Russell
|
|
|
|
|
Thanks a lot for the link, I will save it favourites. I don't really like VB but many applications that we use in the firm need scripting in VB, so soon or late I will must learn it.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hi all,
I want to display the waveform of wav file selected on the dialog.If there is any application or code for reference.Actually i am not able to read the wav file properties and adjust it according to dialog size.
Regards,
Mayank
|
|
|
|
|
Have a look at the Audacity source code.
I will let you google for it; don't worry, it's open-source code.
|
|
|
|
|
when I run the code,it says a wrong about EMS,please help
#include<iostream>
using namespace std;
void two(int k)
{
int x,i=1,n;
int p1[100],p2[100];
while(i)
{
i=k/2;
x=k%2;
k=i;
p1[n]=x;
n++;
}
cout<<n<<endl;
for(int="" a="0;n">0;n--,a++)
{
p2[a]=p1[n-1];
//cout<<p2[a];
cout<<p2[a];
="" }
=""
}
void="" main()
=""
{="" int="" a;
="" cin="">>a;
two(a);
}
|
|
|
|
|
First of all you don't initialize the variable 'n' in your code. so p1[n] is an invalid location. When you try and store a value at that place it would be throwing an error or possibly a crash. Can you just check if this is the root cause?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
thank you .i have find it .a little mistake led on to a great error.
|
|
|
|
|
hey hi all... i made a c++ program in which i need to detect USB device inserted event... but my windowProc function is not getting called.. i don't know whats wrong with the program.... i also tried to check the error by using GetLastError() but i got nothing.. code goes like this
#ifdef WINVER
#undef WINVER
#endif
#define WINVER 0x0501
#include
#include
#include
#include
#include
DEFINE_GUID(GUID_DEVINTERFACE_VOLUME, 0x53f5630dL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
// don't know if this is the correct GUID for USB device interface... i got it from MSDN website....
#define guid GUID_DEVINTERFACE_VOLUME
using namespace std;
HDEVNOTIFY RegisterDeviceNotificationA(
HANDLE hRecipient,
LPVOID NotificationFilter,
DWORD Flags
);
#define RegisterDeviceNotification RegisterDeviceNotificationA
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // device-change event
LPARAM lParam // event-specific data
);
int main( )
{
HWND hwnd = FindWindow( "ConsoleWindowClass", NULL);
cout<<hwnd<<endl; to="" check="" if="" im="" able="" get="" hwnd="" or="" not......
dev_broadcast_deviceinterface="" notificationfilter;
zeromemory(="" ¬ificationfilter,="" sizeof(notificationfilter)="" );
notificationfilter.dbcc_size="sizeof(DEV_BROADCAST_DEVICEINTERFACE);
NotificationFilter.dbcc_devicetype" =="" dbt_devtyp_deviceinterface;
notificationfilter.dbcc_classguid="guid;
HDEVNOTIFY" hdevnotify;
hdevnotify="RegisterDeviceNotification(" hwnd,="" device_notify_window_handle);
cout<<hdevnotify<<endl;="" the="" value
if(="" !hdevnotify="" )
{
cout<<"registration="" of="" device="" notification="" failed"<<endl;
}
else
{
cout<<"registration="" complete"<<endl;
}
dword="" dword;
dword="GetLastError(" );
cout<<dword<<endl;="" for="" any="" error="" any....
while(1)
{
sleep(1000);
}
return="" 0;
}
lresult="" callback="" windowproc(="" uint="" umsg,="" wparam="" wparam,="" lparam="" )
{
cout<<"windowproc="" called"<<endl;="" its="" getting="" called="" not.......
if(="" umsg="=" wm_devicechange="" )
{
cout<<"device="" change"<<endl;
}
return="" defwindowproc(hwnd,umsg,wparam,lparam);="" call="" window="" api="" function="" defwindowproc()="" which
="" provides="" default="" message="" processing="" messages="" that="" were="" not="" processed="" by="" this="" window.
}
output="" is
0x290392="" hwnd
0x245d08="" hdevnotify
registration="" complete
0="" getlasterror()
and="" nothing="" is="" happening="" when="" inserting="" usb.....nyone="" knw="" about="" this
bye="" have="" a="" nice="" day.....=""
<div="" class="ForumSig">bye have a nice day.....
|
|
|
|
|
$w0rdf1$h wrote:
HDEVNOTIFY RegisterDeviceNotificationA(
HANDLE hRecipient,
LPVOID NotificationFilter,
DWORD Flags
);
#define RegisterDeviceNotification RegisterDeviceNotificationA
Why are you re-prototyping this function?
$w0rdf1$h wrote: ...my windowProc function is not getting called.
Why would you expect it to?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
my compiler was saying.... registerDeviceNotification() undeclared.... so i search google.. n put this frm there... now i also tried without prototype.. with correct header files inclueded.. now i am not getting that error but my program is also not working..im not getting any notification.....i can do this using win32 api with winMain() as entry point in place of main().. but point is that i want my program to run in background....i can hide console using ShowWindow(hwnd,1) but i dont know how to hide top level window created in winMain()?????
bye have a nice day.....
|
|
|
|
|
$w0rdf1$h wrote: my compiler was saying.... registerDeviceNotification() undeclared
And rightly so, since registerDeviceNotification() does not exist.
$w0rdf1$h wrote: ...but my program is also not working..im not getting any notification...
Why would you expect to?
$w0rdf1$h wrote: i can do this using win32 api with winMain()...
Probably so (assuming you capitalized it correctly), since it likely has a message pump.
$w0rdf1$h wrote: i want my program to run in background...
What does that have to do with using main() in place of WinMain() ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|