|
|
Great comment. Just reading a book on C windows programming will help. Writting even a few simple apps will give you a real good idea what is going on.
DTrent
|
|
|
|
|
How about the Microsoft Developer Network: http://msdn.microsoft.com[^]. Click on Library for the Platform SDK, Office SDK, .NET SDK, and many other topics. Learning the Platform SDK (PSDK) will give you some insights, but not many people can say how everything works internally. The PSDK seemed to be enough for the Wine development team to emulate Windows on linux and BSD!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
You should take a look at the "Programming Windows" books (I think 5th edition is the current one?) by Charles Petzold.
It won't explain how everything absolutely works inside Windows (only people like Matt Pietrek know that!), but it does show how to write Windows programs in straight C directly to API's. It doesn't use any sort of libraries that end up abstracting the job.
I haven't looked at the newest edition, but the old ones used to sort of be a required reference. In any event, see if you can find a copy at a book store and peruse it.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Kentamanos wrote:
only people like Matt Pietrek know that!
Who's he?!
Sammy
"A good friend, is like a good book: the inside is better than the cover..."
|
|
|
|
|
Do a google search, you'll get a few hits
He basically works for Numega and works on tools like Bounds Checker. He's written lots of articles for MS publications, a few books, and probably knows how Windows works more than 99.5% of MS employees (that's a guess, but it's probably not hyperbole).
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Inside Windows NT is a good overall reference:
http://www.amazon.com/exec/obidos/tg/detail/-/1572316772/002-5183796-2704014?v=glance
|
|
|
|
|
Sometimes being a good hack is the ability to just take a piece out and work with it without an understanding of its internal =)
norm
|
|
|
|
|
I hope I can find an idea here. I have a dataGrid that displays data from a DataSet. It seems to be working well. I have attached a context menu to it. What I am trying to do now is to read the selected row of this dataGrid. The farest I can go is getting the CurrentRowIndex of selected row.
Is there a way to read something from the dataGrid at all? I can't find one method in that class that will do that for me. I am sorry if the question is stupid and there is a simple solution I passed by in the documentation.
thanks a lot.
Alexander.
|
|
|
|
|
datagrid[datagrid.CurrentCell.RowIndex,columnnumber]
Mazy
No sig. available now.
|
|
|
|
|
I am not sure if this is what you are looking for but you can use the DataGrid.CurrentCell to get the row and column which you can use to read the dataset.
|
|
|
|
|
Hello, this is probably the wrong place to post this, but....
I installed the DirectX SDK to play Mp3 files from my applicaton, and made refferens in my application to DirectX dll's(I use MS.Net 2002 C#).
But when I try to play the Mp3 fils from my application (and DirectX SDK samples) I get the error message:
Assert Failed:
|Actual <= GetSize()
At line 3659 of d:\builds\nt32_chk\multimedia\published\dxmdev\dshowdev\base\amfilter.cpp
(I don't have an partion d:\)
So I reinsalled the DirectX 9.0b runtime, and then it works perfect.
But when I now open my application in MS.NET, it can't find the refferens to the DirectX dll's. They have simpli dissaperd, so now I can't rebuild my prodject.
I've tryed to reinstall the SDK, but still it won't find the dll's.
I've uninstalled the SDK, installed it, then I find the dll's,but then I
get Assert Failed message again.
Does anyone have an idee on what I can do?
Thanks
Thomas
|
|
|
|
|
thomasa wrote:
Assert Failed:
|Actual <= GetSize()
At line 3659 of d:\builds\nt32_chk\multimedia\published\dxmdev\dshowdev\base\amfilter.cpp
This happens if the client code is not doing good things with the underlying filters. Assertions prove fault on the client side. To debug this, you need to understand C++. Eventually your client code will be changed. There is 0 chance that the DirectX Quartz library will be changed. May be the simplest thing to do is to try to grab a code somewhere (from the SDK, or from the net) that plays MP3. Are you by any chance adding a custom filter to the filter chain?
When you install the SDK, you reference debug libraries. Thus when you run your app in debug mode, the underlying Quartz filters are also run in debug mode with assertions activated. That's why you don't see anything when you install only the end-user DirectX run-time.
thomasa wrote:
But when I now open my application in MS.NET, it can't find the refferens to the DirectX dll's. They have simpli dissaperd, so now I can't rebuild my prodject.
DirectX managed relies on interop libraries that forward method calls to the underlying COM Quartz libraries back and forth. The interop libraries are simple references in your project. Unfortunately for us all, the path of referenced assemblies is hardcoded in the .csproj file. The consequence is that you lose the reference is you move or install/uninstall anything. In addition, by default, any time you reopen your project in VisualStudio, the referenced interop assemblies are reinteroped, that's why you don't see them anymore. As far as I know, there is no way to circumvent that (other than filing a bug to MS).
Good luck!
RSS feed
|
|
|
|
|
thomasa wrote:
Assert Failed:
|Actual <= GetSize()
At line 3659 of d:\builds\nt32_chk\multimedia\published\dxmdev\dshowdev\base\amfilter.cpp
This is debug information stored in the executable of checked (debug) builds, which means you're using the developer runtime instead of the retail runtime (not the reason for the problems, but the reason for the message). That path was the path of the source file on the original developer's (or build master's, most likely) machine.
I would say reinstall once more. To allow VS.NET to see the managed assemblies, first locate them (mine are in %SYSTEMROOT%\Microsoft.NET\Managed DirectX\v9.00.1126). Open the registry editor (regedit.exe) and add that directory to HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\AssemblyFolders, just like you see the other ones (in a subkey as the default value).
To make sure that the CLR finds them, on each assembly in that directory run gacutil.exe -i <AssemblyName.dll> (or use ngen.exe to build native - pre JIT'd - assemblies which will load faster).
Otherwise, ask on the appropriate newsgroup at news://msnews.microsoft.com[^]. It's not a bad newsgroup to use when developing DX apps anyway. You'll most likely find more specialized help than you would here.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
The problem was fixed by choosing Retail insted of Debug of DirectX runtime at the begining of the instalation of DirectX SDK.
|
|
|
|
|
recently I posted a question regarding licencing commercial components
Den2Fly wrote:
2. How they give license and perform protective actions for such controls while if anyone purchase it can give the .dll to friends and they use it wihout any payment.
Mazy wrote:
Search for LicFileLicenseProvider class.
I studied the SDK documentation and quickstarts about the related classes but am a little confuzed: How can I generate valid .LIC files to be used in validation process by the LicFileLicenseProvider class?
Thanks
---
"Art happens when you least expect it."
|
|
|
|
|
Okay, first of all - don't use the LicFileLicenseProvider class unless you use file contents that can't be changed or produced by a user; see my article at http://www.codeproject.com/dotnet/xmldsiglic.asp[^] for a good way to do this.
Otherwise - like most commercial library companies do - derive from LicenseProvider and create your own provider that stores keys in the registry, validates over the Internet, or something that isn't easy to crack (everything can be cracked , it's only a matter of cost-benefits analysis comparing the worth of the data to be cracked vs. the cost of the resources to crack it).
As far as the files that are generated go, VS.NET automatically creates a .licx file. This simply has the fully-qualified type names of licensed components. You can - and VS.NET does during compilation - run lc.exe on that file to generates a valid .licenses file that must be named the same as the assembly (replacing .dll with .licenses, of course) and added as an embedded resource (using the /res param in csc.exe).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
First I thank you Heath about suggesting implementing an inherited custom class which seems nice.
secondly, .licx file (which I coudn't figure out where it is generated and placed) and .licences files that you say are generated using lc.exe of .licx file, seems not the file that LicFileLicenseProvider class works with. look at this paragraph from Framework SDK 1.1 about LicFileLicenseProvider.GetLicense() method:
"At design time, the GetLicense method looks for a license file named myClassName.LIC, where myClassName is the FullName of the component to create. This file must be in the same directory as the .dll file that contains the component.
Next, this method checks the first line of the license file against a key specified in the IsKeyValid method. If the key is valid, this line is used as the LicenseKey."
what are these .LIC files and how to generate them?
---
"Art happens when you least expect it."
|
|
|
|
|
As I was inferring before, if you are using VS.NET you don't have to worry about the .licx and .licenses files. VS.NET takes care of all this automatically but the licensed component MUST be included in the .exe assembly because the CLR only looks for the valid .licenses files for licensed components in the application itself. Otherwise, developers could get a valid license for one component, wrap it in a library, and distribute it to other developers thereby circumventing the licensing requirement!
The .lic file is the file that the LicFileLicenseProvider looks for. If you derive your own class, you can have it look for any file you want, but that is the default convention for the base LicFileLicenseProvider class. You need to decide what contents to put into it. That's where my article would come in handy for you (it's not bullet proof and is only meant for conceptualization). This is the file that developers could register with you to receive. You override IsKeyValid to determine if 1) the file exists, and 2) if the contents are correct (if you use my article, you'd check the signature to determine that nothing's been changed then check the value(s) and see if they match the computer configuration, like the computer name as an example).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Got it! thanks
I also studied your nice article, I guess I will design a custom licensing pattern based on your digital signature idea.
---
"Art happens when you least expect it."
|
|
|
|
|
Heath Stewart wrote:
create your own provider that stores keys in the registry
You mean the SECRET key? Isn't that very bad place for that?
Mazy
No sig. available now.
|
|
|
|
|
I never said SECRET key. Key is a pretty generic term. There's also public keys, you know. It's just an eval key, an encoded string or something that unlocks the application. I wouldn't recommend this mechanism, though. I referred him to my article about XML Digital Signatures as a viable alternative.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
is there some way to get notified when a form/window /whatever gets "idle"
here is the scenario:
i have a datasouce which will raise events as soon as something changes in it.
i want to do some extra processing on the data once the datasource is fully filled.
when i fill my datasource , the datasource will raise events a couple of times untill it is filled.
so i cant do the processing when the events fire, since that would make it process unfinished data.
so what i would like to know if it is possible to get notified once the current thread/form/whatever is not doing any more work??
//Roger
|
|
|
|
|
See the Application.Idle event.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hello,
I know using try-catch means a performance drop.
I wana know in which part or parts the drop actually happens, does it occurs only when catching an exception or even "trying" a block of code means a drop in comparisson to the same code not inside try block in situation that no exception occurs?
Thanks,
---
"Art happens when you least expect it."
|
|
|
|