|
After digging some more I found that MiscPanel, EditPanel, InfoPanel were FormViews that I had inserted and that they were instantiated in the InitInstance() of the App. They had been registered as Doc Templates. When opening up, the App wanted to know what type of Document I was going to use.
I've commented out the Doc types and I don't think I'll have any problem with them as I'm not printing out of those views jsut insert controls.
|
|
|
|
|
In VB 6.0 I use the following code to get the hard drive serial number. Is there an equivalent method in VC++ 6.0? How about a way to get the BIOS or CPU serial number? Could not find it in the help menu. A code snip would be really helpful. Thanks!
Sub ShowDriveInfo(drvpath)
Dim fs, d, s, t
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath)))
Select Case d.DriveType
Case 0: t = "Unknown"
Case 1: t = "Removable"
Case 2: t = "Fixed"
Case 3: t = "Network"
Case 4: t = "CD-ROM"
Case 5: t = "RAM Disk"
End Select
s = "Drive " & d.DriveLetter & ": - " & t
s = s & vbCrLf & "SN: " & d.SerialNumber
MsgBox s
End Sub
|
|
|
|
|
hi
Use GetDriveType API and c the 'See also' section in MSDN 4 related info.
rgds..mil10
|
|
|
|
|
Freddie Code wrote:
Is there an equivalent method in VC++ 6.0?
See here.
Freddie Code wrote:
How about a way to get the BIOS or CPU serial number?
Use the Win32_BIOS and Win32_Processor classes respectively.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
You can use Windows Management Instrumentation (WMI) SDK for all H/W information you need.
Use Win32_Processor,etc Classes.
Regards,
Darshan Jani
|
|
|
|
|
I get this error
[code]error C2664: '_variant_t::_variant_t(VARIANT &,bool)' : cannot convert parameter 1 from 'const char [5]' to 'VARIANT &'[/code]
when I tried to create a new variant using this code :
[code]_variant_t varID("myID", VT_BSTR);[/code]
what's wrong ?? as the docs says its okay
|
|
|
|
|
hi
There is no default constructor for _variant_t that takes the 'value' and 'VT_BSTR' 2gethor... Simply give the value only. So change ur code with the following.
_variant_t varID(L"myID");
rgds..mil10
|
|
|
|
|
I need to know all main features of MTS,
in details suffitient for passing exam
MCSD 70-015 Distributed C++,
I need articles desribing in some parts
following program:
(Read english topics)
http://www.stars-s.ru/course.asp?c_no=48&d_no=141
or
http://www.stars-s.ru/course.asp?c_no=48&d_no=17330
Do someone know good articles about ISAPI,
in a looking like that program?
Very need.
Thanks.
|
|
|
|
|
Hi guys,
I am trying to copy into a struct the contents of a buffer returned from the winpcap library, the libray function call returns a pointer to the buffer like the following type:
const UCHAR *pkt_data
I am trying to declare something to hold the data where // Packet data ??? is.
typedef struct DATAGRAM
{
UINT packetID;
ip_header ipHeader;
pcap_pkthdr wpHeader;
unsigned char pkt_data[];
} DATAGRAM;
I would prefer to keep it as UCHARS because it makes it easier to parse the data later on into headers such as tcp, so my question is how should declare the type in the struct and how can i copy the data in from the buffer??
Cheers
Packetlos
|
|
|
|
|
This "unsigned char pkt_data[];" should not pass the compiler. Insted the stucture should look something like this:
typedef struct DATAGRAM{
UINT packetID;
ip_header ipHeader;
pcap_pkthdr wpHeader;
unsigned char pkt_data[1];
} DATAGRAM;
Then if you know if you know the nuber of bytes you will be receiving you can allocate the need memory like so:
DATAGRAM* pDatat = (DATAGRAM*)malloc(sizeof(DATAGRAM) + nDataSize) or the C++ equivalent to allocate the need memory and then copy the data into pData->pkt_data as you see fit. If you do not know the data size ahead of time things get a lot more complicated and you may want to use one of the STL templates or if programming using MFC you could replace "unsigned char pkt_data[1];" with "CByteArray pkt_data;". CByteArray stores unsigned chars, because that is what a byte is.
Good Luck1
INTP
|
|
|
|
|
Hi John,
Thanks for taking time to reply, CByteArray seems to be exactly what I need, I can calculate the size of the data and set the CByteArray like this:
<br />
tempDatagram.pkt_data.SetSize(dataLen);<br />
But then how do I copy the data into the array using the given pointer to the buffer of UCHARS?
|
|
|
|
|
Sorted with:
MoveMemory(tempDatagram.pkt_data.GetData(), pkt_data, dataLen);
|
|
|
|
|
I can't use double and float variables correctly.
When I appoint a float or double values to float or double variables, The variables have 0.0 or 1.0 values. they don't have another values.(for example 0.152 or 0.53 ...)
I don't solve this.
or is there another usage float and double variables? I haven't known
deniz
|
|
|
|
|
deniz79s wrote:
or is there another usage float and double variables? I haven't known
No!
double d = 0.0;
double d = 1.0;
double d = 0.152;
double d = 123.456;
float f = 0.0;
float f = 1.0;
float f = 0.152;
float f = 123.456;
should all produce the correct results. Now if you wher trying to do something like "if( d == 1.0 )" you may be having a problem (don't do that!).
INTP
|
|
|
|
|
Hello,
it is the first time I have to distribute self-written applications
in Visual C++.
Now I am facing the following problem: My application needs some DLLs
that are not present on a standard Windows XP installation. I know that
because I can run it on my PC where I have installed Visual Studio also. When I run it on a XP-only (without VS) system, it crashes with error code xxx135 which means missing DLL.
Now what I did was using depends 2.1 to see all the DLLs that I need.
However now I do not know which ones of them I have to include with my
application installation routine. All of them would sure be overkill, since there are some standard dlls that are present on all Windows platforms I believe.
But how do I know which DLLs are definitely present and which ones I have to add to my installation package?
Thank you very much for your help.
Tony
|
|
|
|
|
There may not be a definite way to predict which DLL's are already on your customer's system and which are not but basically, if the customer is using Windows2000 or higher versions OS, you may just assume this:
If you did not specifically include any ".lib" files into your project, then you do not need to worry about DLL's, if you did, however, you will need to distribute the corresponding DLL's as well.
One more thing, if you used VC.net to develop your application, then "MFC70.DLL" must be distributed because most OS's(including Win XP) do not have that file by default.
|
|
|
|
|
Abin,
thank you very much for that information, that helps a lot.
I was really having a hard time because I used a code example
from codeguru.com on how to get the MAC Address of the PC.
http://www.codeguru.com/Cpp/I-N/network/networkinformation/article.php/c5451
I used Method 3 (GetMACAdapters) and this includes
iphlpapi.lib. Now DependencyWalker showed it relied
on EFSADU.DLL which was not present on XP Home. So I
was very confused. I now learned that although DepWalker
lists EFSADU.DLL (which is called by IPHLAPI.DLL), this
does not mean that it is explicitly linked.
I must say that I have not really understood the concept between
explicitly and implicitly linking, so I will try to learn about
it.
Thank you again,
Tony
|
|
|
|
|
Hi All,
I have written a server application, which accepts info from other client machine (this for the present is being simulated wthrough HyperTerminal).
After I reviece a packet from the Hyper terminal (comprising of a UserID and Passwd), I check against a DB (I am Using ADO DB Calls). I am trying to open the DB connection and the Recordeset inside the Server thread. Here it fails, (Open returns a FALSE). The DB Calls works well outside the thread.
Can the DB Calls be never made from within a thread..
Please advise. Any Help is appreciated
|
|
|
|
|
hi
Make sure u have called ::CoInitialize() in the thread.
rgds...mil10
|
|
|
|
|
Hello,
I am working on Win32 API platform. I have tried the message "WM_NCMOUSELEAVE" in Win 2000 OS. In 2000 OS the message will not get. but it is working in XP OS Fine. Can u please help me for this problem. I need to get the message (WM_NCMOUSELEAVE) in 2000 OS also.
Thanks in Advance
Baskar
Baskar
|
|
|
|
|
You should use Spy++ to confirm you are correct. My guess is this is not your problem.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
|
here i am developing an application in which i need to add a button in IE regarding my applicaitons options. How shall i do that.
One more thing is that is it posiible to add buttons or toolbars to .exe files
if possible how shall i do that.
Basheer
|
|
|
|
|
You can search for toolbar here in CP , there are few articles on that
|
|
|
|
|
Use the interface of IE explorer. It is well documented in MSDN.
|
|
|
|