|
sounds more like an asp question may be asp.net forum may help you.
GameBoy™ wrote:
if ( noobie = "confised" )
confised or confused?
This space is empty.
|
|
|
|
|
Well
if ( noobie = "confused" )
{
print "Search Google© for answer";
will always be true, and he will be searhing the google, else will never occur
|
|
|
|
|
How can I find out why my program is eating up 90%+ of the cpu on certian functions in a thread? The slowest functions do the following:
Parse out xml contents from an string (loop, CString::Mid) its like 7000 of these ... its not finding any corruption but its just really slow its in a thread and just is taking up a lot of the cpu.
Loops through all the items in a CArray structure (CStrings ctime, and one or two floats) and just does some stuff with teh float and scores of text.. but its takes like close to a minute
Are there any optimization techniques cause its taking like 3/4 minutes for the feature to complete its task and eats up a lot of resources on a 1.5ghz 128mb ram machine , not even wmp9 does that.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
How many threads? Sounds more like there is an infinite loop.
Kuphryn
|
|
|
|
|
Operations on float are costly.
This space is empty.
|
|
|
|
|
Yea the problem is I need percision to the 5 or 6 descimal place... what operator should I use?
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
(Steven Hicks)n+1 wrote:
Yea the problem is I need percision to the 5 or 6 descimal place... what operator should I use?
humm, i dont think you can do anything about it, you can only optimise the operation.
like remove unnecceary float converstion.
other wize you can always put that in a worker thread and show the progress to the user.
This space is empty.
|
|
|
|
|
Without seeing sample code, it is hard to say.
When used poorly, CString can be VERY expensive. Floating isn't expensive at all unless you are doing millions and millions of operations.
CArray can also cause some problems, but not with static contents.
BTW, are you doing timing tests with the release version?
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Yes this is the release version, taking 3 some times more (not including download time) minutes.
The CStrings are used because the url string is pretty unpredictible.. yea most are under 80 but you never know ugh (therefore need a dynamic string)
Their are about 7 float operations per item.
In my test set there are 200 articles it is going though, therefore again the CString is needed for title and description publisher etc
its doing somewhere close to 1400 or more float operations.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
When you consider the number of floating point operations we do per frame in a video game, 1500 float operations are nothing.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
i want to insert a thingy where you click on the right side then it drop down with DRIVES and Directory tree. is it the drop down combo box with some code or diferent one?
|
|
|
|
|
that thingy is a combo box custom made i suppose by microsoft.
This space is empty.
|
|
|
|
|
|
Hi everyone,
I need some help
I'm trying to get the MAC addresses for physical NIC's on the local P.C using multiple methods, getadapterinfo and snmp.
I have one instance where a P.C has VPN software installed (not microsofts) and thier virtual adapter is returning in these programs with a adapter type = 6 (ethernet adapter). I need only physical addresses for use of licensing.
Is there any way to identifier what adapters are physical, and what adapters are virtual???
Also should all virtual adapters be classified as a PPP adapter???
any help would be appreciated
Thanks in advance
Gilc137
|
|
|
|
|
I am not really sure what you want,
but if you were to do it in Windows,
you can use WMI to query the Win32_NetworkAdapterConfiguration object to get the MAC address
or via the registry - SOFTWARE\\Microsoft\\Windows NT\\Current Version\\NetCards
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Thanks for your reply,
Let me just clarify exactly what I trying to do (I fairly new to this):-
We have a application software that can run on windows and currently the way the software licensing piece works, is that it using the netbios method to retrieve the NIC's mac address. This method works fine if you have netbios installed and are physically connected to a network. There are situations that clients do not have netbios or that they want to run this application on a standalone P.C (not connected to a network).
What I trying to do is to include other methods of obtaining the MAC addresses as part of the licensing checking to ensure that we get all valid ethernet MAC addresses from the physical network cards installed on the local server or local p.c, Then just pass a list of valid MAC address to the licensing function (Clients can have mupltiple network cards installed).
I have added the use of getadaptersinfo, snmp method (query through Winsock) and UuidCreateSequential (this only support single NIC's). On the first two methods I have coded it to only pick up ethernet adapters (adapter type = 6)
These other methods seem to work fine, but I have come accross a situation when someone has VPN software installed on there P.C (not microsoft VPN) and the methods that I have added are picking this virtual adapter MAC address (which is different from any of the network cards installed on the P.C).
Therefore I'm not sure if the 3rd party VPN software has defined thier virtual adapter incorrectly as a ethernet adpater(6), when they should have defined their adapter as a PPP adapter or anything other then a ethernet adapter. OR if there is a method to exclude VPN adapters so that I can return only valid MAC addresses from the physical network cards installed on the local server or local P.C
Apoligize for the long winded message.
Thanks for your suggestion,
Thanks in advance
Gilc137
|
|
|
|
|
Eventhough that they have VPN installed, they should not have been able to change the MAC address unless they have physically changed the NIC or they have more than one NIC installed.
One way to make sure you could get the MAC address you want is (ancient way)
Make a copy of WORKING MAC address into a text file or what so ever when the your program was initially installed into the system. When they have somehow did funny thing to make the MAC detection doesn't work . At least you have a backup MAC address. Of course this sound not too flexible but it can act as a backup plan to your solution.
Hope this helps
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi,
is there any way, how to do automatic code comments in C++? Microsoft added this feature only to C# in .NET 2003.
Pavel Celba
|
|
|
|
|
i think there are some free comment tools in the tools section of the codeproject.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
how do you get your program to communicate across a LAN?
til
|
|
|
|
|
By using Winsock. Search this site and you'll find a dozen of articles about network programming!
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
I guess ur problem is related to proxy servers... you need to know about the type of proxy server you have.. mostly it is HTTP 1.1
This space is empty.
|
|
|
|
|
Hi,
I wrote a test application that trapped WM_DEVICECHANGE. It worked fine so I tried the same thing in a service but I can't seem to catch events in services. Am quite a newbie to Visual C++ so would appreciate all the help i can get.
Can I trap such events in services?
Mark
|
|
|
|
|
Create a hidden window in the service and in then message proc you can then listen to the messages.
Interviewer (me) : "Did you install Linux all my yourself?"
Candidate : "Yes i installed Linux all my yourself."
|
|
|
|
|
Currently, I have this code in my on paint event in a view.
<br />
CPaintDC dc(this);<br />
<br />
CPoint originalSize = matrix.GetSize();<br />
int y, x;<br />
<br />
for (y = 0; y < size.y; y++)<br />
{<br />
for (x = 0; x < size.x; x++)<br />
{<br />
dc.SetPixelV(CPoint(x,y), obj.GetColorRef(CPoint(x, y)));<br />
}<br />
}<br />
<br />
As you can understand, this is pretty slow with soewhat bigger pictures where for example, tje size is over 1000 x 1000 pixels. A solution, as far as I know, is to use a memory DC. However, I am doing something wrong.
I want to create the memory DC with the following
<br />
CPaintDC dc(this);<br />
CDC pdc;<br />
dc.CreateCompatibleDC(&pdc);<br />
<br />
CPoint originalSize = matrix.GetSize();<br />
int y, x;<br />
<br />
for (y = 0; y < size.y; y++)<br />
{<br />
for (x = 0; x < size.x; x++)<br />
{<br />
pdc.SetPixelV(CPoint(x,y), obj.GetColorRef(CPoint(x, y)));<br />
}<br />
}<br />
<br />
dc.BitBlt(0, 0, size.x, size.y, ...) <br />
<br />
However, the first time only a black block was drawn then, when resizing things go wrong (the app crashes), where a colored block should be drawn. What am I doing wrong, and if I am doing it wrong, how should I do it?
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|