Today I’ve discovered that I’m denied access to several folders in Windows 7. Now, you might be thinking ‘Did you try running Explorer with Administrative privileges?’. Of course I have!

The list of folders that I was denied access to is the following:

 

  • Access to the path ‘C:Documents and Settings’ is denied.
  • Access to the path ‘C:ProgramDataApplication Data’ is denied.
  • Access to the path ‘C:ProgramDataDesktop’ is denied.
  • Access to the path ‘C:ProgramDataDocuments’ is denied.
  • Access to the path ‘C:ProgramDataFavorites’ is denied.
  • Access to the path ‘C:ProgramDataMicrosoftWwanSvcProfiles’ is denied.
  • Access to the path ‘C:ProgramDataStart Menu’ is denied.
  • Access to the path ‘C:ProgramDataTemplates’ is denied.
  • Access to the path ‘C:RRbackups’ is denied.
  • Access to the path ‘C:System Volume Information’ is denied.
  • Access to the path ‘C:Users<username>AppDataLocalApplication Data’ is denied.
  • Access to the path ‘C:Users<username>AppDataLocalHistory’ is denied.
  • Access to the path ‘C:Users<username>AppDataLocalTemporary Internet Files’ is denied.
  • Access to the path ‘C:Users<username>Application Data’ is denied.
  • Access to the path ‘C:Users<username>Cookies’ is denied.
  • Access to the path ‘C:Users<username>DocumentsMy Music’ is denied.
  • Access to the path ‘C:Users<username>DocumentsMy Pictures’ is denied.
  • Access to the path ‘C:Users<username>DocumentsMy Videos’ is denied.
  • Access to the path ‘C:Users<username>Local Settings’ is denied.
  • Access to the path ‘C:Users<username>My Documents’ is denied.
  • Access to the path ‘C:Users<username>NetHood’ is denied.
  • Access to the path ‘C:Users<username>PrintHood’ is denied.
  • Access to the path ‘C:Users<username>Recent’ is denied.
  • Access to the path ‘C:Users<username>SendTo’ is denied.
  • Access to the path ‘C:Users<username>Start Menu’ is denied.
  • Access to the path ‘C:Users<username>Templates’ is denied.
  • Access to the path ‘C:UsersAll UsersApplication Data’ is denied.
  • Access to the path ‘C:UsersAll UsersDesktop’ is denied.
  • Access to the path ‘C:UsersAll UsersDocuments’ is denied.
  • Access to the path ‘C:UsersAll UsersFavorites’ is denied.
  • Access to the path ‘C:UsersAll UsersMicrosoftWwanSvcProfiles’ is denied.
  • Access to the path ‘C:UsersAll UsersStart Menu’ is denied.
  • Access to the path ‘C:UsersAll UsersTemplates’ is denied.
  • Access to the path ‘C:UsersDefaultAppDataLocalApplication Data’ is denied.
  • Access to the path ‘C:UsersDefaultAppDataLocalHistory’ is denied.
  • Access to the path ‘C:UsersDefaultAppDataLocalTemporary Internet Files’ is denied.
  • Access to the path ‘C:UsersDefaultApplication Data’ is denied.
  • Access to the path ‘C:UsersDefaultCookies’ is denied.
  • Access to the path ‘C:UsersDefaultDocumentsMy Music’ is denied.
  • Access to the path ‘C:UsersDefaultDocumentsMy Pictures’ is denied.
  • Access to the path ‘C:UsersDefaultDocumentsMy Videos’ is denied.
  • Access to the path ‘C:UsersDefaultLocal Settings’ is denied.
  • Access to the path ‘C:UsersDefaultMy Documents’ is denied.
  • Access to the path ‘C:UsersDefaultNetHood’ is denied.
  • Access to the path ‘C:UsersDefaultPrintHood’ is denied.
  • Access to the path ‘C:UsersDefaultRecent’ is denied.
  • Access to the path ‘C:UsersDefaultSendTo’ is denied.
  • Access to the path ‘C:UsersDefaultStart Menu’ is denied.
  • Access to the path ‘C:UsersDefaultTemplates’ is denied.
  • Access to the path ‘C:UsersDefault User’ is denied.
  • Access to the path ‘C:UsersPublicDocumentsMy Music’ is denied.
  • Access to the path ‘C:UsersPublicDocumentsMy Pictures’ is denied.
  • Access to the path ‘C:UsersPublicDocumentsMy Videos’ is denied.
  • Access to the path ‘C:WindowsRegistrationCRMLog’ is denied.
  • Access to the path ‘C:WindowsSystem32comdmp’ is denied.
  • Access to the path ‘C:WindowsSystem32configsystemprofileAppDataLocalApplication Data’ is denied.
  • Access to the path ‘C:WindowsSystem32configsystemprofileAppDataLocalHistory’ is denied.
  • Access to the path ‘C:WindowsSystem32configsystemprofileAppDataLocalTemporary Internet Files’ is denied.
  • Access to the path ‘C:WindowsSystem32configsystemprofileApplication Data’ is denied.
  • Access to the path ‘C:WindowsSystem32configsystemprofileCookies’ is denied.
  • Access to the path ‘C:WindowsSystem32configsystemprofileLocal Settings’ is denied.
  • Could not find a part of the path ‘C:WindowsSystem32configsystemprofileSendTo’.
  • Access to the path ‘C:WindowsSystem32LogFilesWMIRtBackup’ is denied.
  • Access to the path ‘C:WindowsSysWOW64comdmp’ is denied.
  • Access to the path ‘C:WindowsSysWOW64configsystemprofileAppDataLocalApplication Data’ is denied.
  • Access to the path ‘C:WindowsSysWOW64configsystemprofileAppDataLocalHistory’ is denied.
  • Access to the path ‘C:WindowsSysWOW64configsystemprofileAppDataLocalTemporary Internet Files’ is denied.
  • Access to the path ‘C:WindowsSysWOW64configsystemprofileApplication Data’ is denied.
  • Access to the path ‘C:WindowsSysWOW64configsystemprofileCookies’ is denied.
  • Access to the path ‘C:WindowsSysWOW64configsystemprofileLocal Settings’ is denied.
  • Could not find a part of the path ‘C:WindowsSysWOW64configsystemprofileSendTo’.

As you’ve probably already figured it out, the list contains also the special folders from the 64bit environment that aren’t accessible.

The thing is, as it appears, that these aren’t actual folders, but so-called junction points, created to offer backward compatibility with other operating systems (Vista, XP…).

Now, if you might have been able to see them in Vista (as shortcuts), and access them (which would have redirected you to the actual folders), there is a small glitch in Seven: you don’t see them, not even as shortcuts, and if you try to manually insert these folder paths and open them, instead of being redirected to the actual folders, you’ll get an error saying that access is denied. Honestly, I would have liked to get an ‘path does not exist’ or something similar.

So, how did I get this list? Well, I ran a folder-listing application I’ve written in .NET Framework, and the GetDirectories() method returned these folders as sub-folders of their parents (sounds fishy :)).

So here’s the thing with backward compatibility:

  1. you have an app that does some IO ops in the special environment folders
  2. the .NET Framework returns these special folders as existing
  3. you run your app with elevated privileges to make sure no errors occur
  4. boom, you get an access denied error on some special folders that don’t actually exist.

Is it just me, or is there a glitch somewhere?

P.S.: more about junction poins here: http://www.svrops.com/svrops/articles/jpoints.htm

Hey guys! These were truly some days when evil was hovering over me!… or at least, so I thought!

I’ve been trying since last Saturday to deploy a Win CE application I’ve written in C# for a new embedded board I’ve received from Microsoft as a prize, but I kept getting this annoying errors, like “the Compact version used is too old” or “the application is already running” (and of course, it wasn’t running) and so on.

Since I’ve got that first error, I believed that there was a problem with the WinCE image I’ve built. So, just to be 100% sure that the problem was the image (which I admit, didn’t find to have build-logic problems), I’ve tried deploying the image on another older board, with another image of course, also on an x86 architecture, an image that I knew was perfectly capable of running anything I had in mind.

But what about this? I plug in the cross-over cable, boot the image, run Coreman for deploying the app I’ve written and boom: “Deployment and/or registration failed with error: 0x8973190e. Error writing file ‘WindowsSystem_SR_enu.cab’. Error 0x8007274c: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.” I try the Coreman again, run the debug again, and then I get “the process is already running bla-bla-bla”.

So what to do next? Well, first I was thinking of writing an e-mail for support, but whom to write to? And what to write? Writing an e-mail with “nothing works” as subject, and the posted error in the body of the e-mail would have probably been ignored… And then it came to me: what if the network board is broken (to be read as f***** up”)?

A short history lesson: back in December I had to buy a new network board for my laptop because I’ve accidentally broken a pin of the original on-board Intel gigabit network board. And since it isn’t possible to change the on-board network module, I’ve decided to buy the best PCMCIA network board on the market: the D-Link DGE-660TD Gigabit board.

Enough with the history lesson. So here I am, unplugging my D-Link network board. I dock the laptop in the Lenovo docking station, plug the cable into the docking station network socket, change the IP addresses as required, start Coreman all over again, press deploy and taa-daam: deploy succeeded.

Don’t know if any of you ever had similar problems, but googling any of the errors I’ve got during these last 4 days I had absolutely didn’t help at all, so…

Ok, that’s it for today!

Alex

This was a rough morning, all right! Especially since it was so difficult to insert an ampersand (&) in that freakin’ label!

So the problem is that & is used for the mnemonic function (you know… in case you want the File menu to pop up when you press the ‘F’ key on your keyboard, you would name the File menu as ‘&File’).

untitled4

Therefore, having a label text called ‘a&b’ would require:

1. disable the menmonic function: UseMnemonic = False

2. change the label’s text to a&&b

untitled5

I admit it’s kind of lame to have a post about this, but you just might wonder one day why your label isn’t listening 🙂

Sometimes, just sometimes, it’s very frustrating to search for something that isn’t there, isn’t it? 🙂

I was trying to make a tutorial on how to use the built-in setup and deployment system that VS05 offers in the form of Setup and Deployment projects, and the result was that I was ‘hanging’ at the customization part, specifically at changing things like the ‘default company name’ tag. Why is was so difficult? Well, basically, because it just wasn’t there.

After googling around, I even found out that the tags can be changed using some key inside the HKLMSOFTWAREMicrosoftWindows NTCurrentVersion, but this is totally unacceptable, of course (to be honest, I didn’t even succeed in that method either).

So I’ve been looking and looking for about 1 hour for those impossible-to-find tags, when I finally decide to dock the Properties windows and surprise: there they are.

Take it like this: right-click-ing the Setup project created inside the solution brings you to the Setup Property Pages windows, which contains a set of completely different properties than the ones listed in the Properties toolbox. This is frustrating and confusing, since almost everything in VS works different: right click-ing a component in Solution Explorer toolbox (or even Catalog Item toolbox) will either pop the Properties toolbox or pop a windows with the mostly the same properties listed in the Properties toolbox…

So, whenever you are looking for changing the default tags from a setup project, remember to check the one and only: PROPERTIES TOOLBOX. 🙂

Alex 🙂

coming up next: how to create an installer with a professional feeling, sparing the $1000+ required for InstallShield or InstallWise.

This is one of those days, when you do one thing, you compile, everything works perfectly, but for some reason, the second time you compile, nothing works any more :).

Platform Builder 6 has a very complex sequential build process. In theory, is has four main steps:

  1. the compilation phase
  2. the sysgen phase
  3. the release copy phase
  4. and the make run-time image phase

Each of these steps uses a very large number of small files containing module and file definitions that will be included in the final image, registry keys and values for the run-time image created during a cold boot, RAM file system directories, files and links, database to be included in the object store of the run-time image, created also during a cold boot and locale-specific definitions (strings), that will replace visible texts to a user.

In conclusion, lots of files, which lots of values. Therefore, lots of possible vulnerabilities.

Now, as I mentioned in the beginning of the post, this is one of those days, when a WinCE6.0 process works perfectly, until boom! No modification done to the image, and while building a second time, I get lots of strange errors (ok, I admit, I did add some insignificant registry keys, but there’s no way a registry key could affect missing .tmp files used during a build process).

After a lot of digging up and re-re-re-re-re-re-re-build, I’ve realized it’s all got to do with my antivirus. Even though I pray for health and wealth for its developers when I go to sleep, I do admit it has a drawback: scanning the opened files used by an application will delay application responsiveness and therefore, the build process.

Apparently Kaspersky isn’t related in any way to Platform Builder (unfortunately), so I had to manually detect which are the executables that run most often in the build process of a WinCE 6 O/S image and create an exclusion for them. Since most of the anti-viruses has such a drawback, I’ll list them so you can add them yourself to your anti-virus’ exclusion list as well:

  • Platform Builder addlib (<WinCE installation folder>publiccommonoakbini386addlib.exe)
  • Platform Builder Res2Res Resource Copy Tool (<WinCE installation folder>publiccommonoakbini386res2res.exe)
  • Platform Builder Build File Filter Tool (<WinCE installation folder>publiccommonoakbini386cefilter.exe)
  • Microsoft Resource File to COFF Object Conversion Utility (<WinCE installation folder>sdkbini386cvtres.exe)
  • Microsoft Linker Stub (<WinCE installation folder>sdkbini386editbin.exe)
  • Microsoft Program Database (<WinCE installation folder>sdkbini386mspdbsrv.exe)
  • Platform Builder Program Maintenance Utility (<WinCE installation folder>sdkbini386nmake.exe)
  • Microsoft Incremental Linker (<WinCE installation folder>sdkbini386x86link.exe)
  • Platform Builder PBSpawn Utility (%Program Files%Microsoft Platform Builder6.00cepbIdeVSPBSpawn.exe)
  • Microsoft Visual Studio 2005 (%Program Files%Microsoft Visual Studio 8Common7IDEdevenv.exe)

Addid this files should help you in case you keep getting random BLDDEMO errors, which don’t really say much of an error in the error or log file…

So, in conclusion, there are some executables that would like to open a file, but the anti-virus kicks in, scans the file and executable will stop with an error for not being able to open (read ‘find’, instead :-)) the file. So what you should do is to add a collection of executables as exclusions to the anti-virus, thus not scanning the files that those executables open.

That’s all for now.

Alex

P.S.: You might find that xcopy or copy will also be used (doh!). Adding them as an exclusion is however not such a bright idea, since most viruses will use either of them to populate themselves through the drives…

Guess what! The goodies have arrived 🙂

The GPS project I will soon start working on is about to… be started :). Today the courier has finally arrived with the GPS Evaluation board and the GPS receiver module, which rocks :). Surely, there wasn’t much time to test everything, since it have only passed like 20mins since I’ve received the first pieces of the puzzle. So far, I have the GPS-08334 Evaluation board (this is actually optional, but is great – in my opinion – for starters) and the EM-406A SiRF III Receiver. I’ve ordered them from sparkfun.com (I can totally recommend it, even if it’s 10% more expensive than other online electronic shops). Pictures were taken with my HTC HD2 (aren’t they awesome?).

IMAG0031 IMAG0033

Pieces (of the puzzle) yet to receive: the Vortex embedded board.

Just for fun, I’ve tested the module using the SiRFDemo application, and everything worked like a charm! I’ve connected the eval board to the development station (which is currently an IBM T60 laptop) using the USB connection available due to the evaluation board. For the final project, I intend to use RS232 only.

So what’s next? I’ll write my own NMEA class for the communication with the GPS receiver module (again, over RS232).

To be continued…

Alex

Here’s to my BFF, Vlad!

Words are not adequate enough in this difficult times he’s facing! Vlad, lean on your friends for strength, love and happines! And most important, always remember that we’ll be there for you!

With lots and lots of sadness in my heart,

Alex

I’ve just realized there is no working solution in C# on how to programatically select cells across a dataGridView.

What I needed was a quick, simple and easy solution on the next behaviour: a user clicks a cell (any kind of cell: may it be a textBox cell, a checkBox cell, a comboBox cell etc.), the cell gets selected, the user clicks another cell, both the new cell and the previous cell are selected, the user click the first cell again, only the second cell is selected.

How I’ve done this? Well, first, it’s important to keep in mind that the events occur like this: CellMouseDown, CellClick, CellContentChanged, CellMouseUp, SelectionChanged. Sure, there are so many other events as well, but it’s important that you use only the CellContentChanged and the SelectionChanged events. Moreover, be aware, that if you try using the CellClick event, you won’t get this desired behaviour :).

What’s more to add, please keep in mind that you will have the MultiSelect property set to True. It would be also nice to have the SelectionMode set to CellSelect, so you don’t need to take care of several exceptions that could occur if you select the entire row/column by clicking on the column header or row header.

So:

– first, declare a System.Collections.ArrayList arrayList = new System.Collections.ArrayList(); This is where you will save a list of all of your selected cells. Sure, it would be nice to save the SelectedCells collection of the DataGridView, but that collection is obviously read-only. Otherwise, I probably wouldn’t even have this post :P.

– second, in the SelectionChanged event, do this:

foreach (DataGridViewCell arrayElement in arrayList)
{
arrayElement.Selected = true;
}

And in the CurrentCellChanged, do the following:

if (dataGridView1.CurrentCell != null)
{
label1.Text = (dataGridView1.CurrentCell.RowIndex + 1).ToString() + ” ” + (dataGridView1.CurrentCell.ColumnIndex + 1).ToString();
if (arrayList.Contains(dataGridView1.CurrentCell))
{
arrayList.Remove(dataGridView1.CurrentCell);
dataGridView1.CurrentCell.Selected = false;
}
else
{
arrayList.Add(dataGridView1.CurrentCell);
dataGridView1.CurrentCell.Selected = true;
}
}

This is basically it. Now, there is a thing about this code. The thing is that is you click on a column header, in order to re-sort the column, you’ll have a rather strange “error”: your last selected cell will get de-selected. If you re-sort the column again, the cell will be selected again. The fault of this occurrence is due to the way the events are called. Basically, when you click the header, the CurrentCellChanged is called for a first time, since you clicked the header (so, dataGridView.CurrentCell will be null). Afterwards, the CurrentCellChanged is automatically called again, because current cell’s position is moved (so the event is called for some reason…).

There are several ways to get along with this thing; I’ll let you find your own solution, since:

  1. I for one, needed NonSortable columns
  2. I needed the column headers hidden

Alex M.